JAVA code to create file in Linux with specific permission


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Old 3 Days Ago
JAVA code to create file in Linux with specific permission

Hi All,

I'm looking for JAVA code to create file in Linux with specific permission

File should be created and saved in Linux in this path \opt\sys\doc by Java with this permission 764

Anyone can help to provide this Java code
# 2  
Old 2 Days Ago
Quote:
Originally Posted by AbuAliiiiiiiiii
I'm looking for JAVA code to create file in Linux with specific permission
There is a generic system call for that, fopen(). Have a look at its man page and report back if anything in there is unclear.

Quote:
Originally Posted by AbuAliiiiiiiiii
File should be created and saved in Linux in this path \opt\sys\doc by Java with this permission 764
First off, i'd like to question the rationale behind 764. That would mean to give execute rights to the owner and i would be quite surprised if you would want to create an executable.

Second, the path: "\opt\sys\doc" is not a path but rather a filename. Since you do not need to escape regular characters you could also write "optsysdoc" to the same effect. So, what is the path?

I hope this helps.

bakunin
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Create an user with limited permission on LUbuntu enodev Ubuntu 0 10-20-2016 09:57 PM
Need a script to create file permission change restriction mr.trilok Shell Programming and Scripting 8 06-22-2016 08:36 AM
Change file permission of mounted drive Linux yifangt Shell Programming and Scripting 4 10-23-2015 04:32 PM
Create a new file from another file with lines begins with a specific string Litu1988 Shell Programming and Scripting 4 09-01-2014 11:52 AM
How to create a Group with rwx permission? shouvanik UNIX for Dummies Questions & Answers 4 08-20-2013 04:33 PM
Is it possible to create 10GB file in Linux and transferring the file to other remote server scriptscript Shell Programming and Scripting 3 03-23-2013 04:59 AM
Linux through Java code Dorothy Linux 1 08-19-2012 02:18 PM
command linux in java code chercheur857 Programming 0 04-28-2012 12:11 PM
How to create a file with 777 permission.? sanoop UNIX for Dummies Questions & Answers 10 02-21-2012 06:38 PM
Create File with specific Length nishantrk UNIX for Dummies Questions & Answers 2 10-17-2011 06:48 AM
can i have an optimal solution for this java code ? Facing Java heap space problem even at 3GB heaps vaibhavkorde Programming 2 04-12-2011 02:51 AM
Need help in writing a script to create a new text file with specific data from existing two files shashi143ibm Shell Programming and Scripting 1 08-06-2010 04:48 AM
How to create a file with full permission in unix script sbmk_design Shell Programming and Scripting 2 12-01-2009 03:33 PM
granting permission to file/directory to a specific user run123 UNIX for Dummies Questions & Answers 2 05-26-2009 11:47 AM
How to create file in ksh scripting with permission(rw-rw-rw) mansa Shell Programming and Scripting 1 11-16-2008 07:39 AM