简体   繁体   中英

Setting a Umask value for a particular directory and not a user

I have one directory named as MAIN_OUTPUT. I have a JAVA application which will create some files and directories under MAIN_OUTPUT. The users submitting the java applications are different all the times. Now the requirement is to set the umask for this particular directory(MAIN_OUTPUT) as 0002, so that all the files generated will have read-write permissions. Can anyone suggest a way for this?

Thanks, Ankur

If you want everybody to be able to write into that directory, but that the files remained owned by directory owner, you could do from your Unix/Linux terminal:

chmod 1775 <complete path>/MAIN_OUTPUT

Then from time to time, directory owner can come here and give permissions to everyone, since he still owns the file.

You may find more expertise on http://unix.stackexchange.com though.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM