LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to set permission of a file created by java? (https://www.linuxquestions.org/questions/linux-general-1/how-to-set-permission-of-a-file-created-by-java-613577/)

emanresu 01-14-2008 07:19 PM

How to set permission of a file created by java?
 
I have searched online, but could not find any clear solutions.

Basically my java program writes files to a linux directory. The directory itself has 755; but the files created only has 700. What can I do so that the files will also have 755? I am looking for a solution that is either done once from Linux or programmatic solution from Java, but I would like to avoid having to use Runtime.exec to call chmod because it would be a hack. Thanks.

trickykid 01-14-2008 10:23 PM

umask is your friend.

man umask

arnabneogy 01-15-2008 06:18 AM

umask 022
will work

emanresu 01-15-2008 03:03 PM

thanks guys! that worked!

san85gire 01-23-2008 01:54 AM

how to take backup in ubuntu destop 7.10
 
hi friends's
i am new for linux. l have info. about backup in linux. ple tell me how to take backup linux. i am using ubuntu desktop 7.10

thanks


All times are GMT -5. The time now is 09:00 PM.