LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-14-2008, 07:19 PM   #1
emanresu
Member
 
Registered: Apr 2004
Distribution: Gentoo
Posts: 76

Rep: Reputation: 15
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.
 
Old 01-14-2008, 10:23 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
umask is your friend.

man umask
 
Old 01-15-2008, 06:18 AM   #3
arnabneogy
LQ Newbie
 
Registered: May 2006
Posts: 4

Rep: Reputation: 0
umask 022
will work
 
Old 01-15-2008, 03:03 PM   #4
emanresu
Member
 
Registered: Apr 2004
Distribution: Gentoo
Posts: 76

Original Poster
Rep: Reputation: 15
thanks guys! that worked!
 
Old 01-23-2008, 01:54 AM   #5
san85gire
LQ Newbie
 
Registered: Nov 2007
Posts: 2

Rep: Reputation: 0
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I set default file/directory permission levels? toes Linux - Security 5 01-05-2007 06:21 PM
can't set leading "s" in file permission toddcurry Linux - General 2 10-19-2006 05:34 PM
FTP, newly created files permission georgiozoze Linux - Newbie 2 09-16-2006 08:47 PM
How to set permissions for newly created dirs? z-vet Linux - General 2 12-04-2004 08:06 AM
Permission for files created in NT for Linux use strik3r Linux - General 1 02-25-2004 04:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration