-
All replies
-
Helpful answers
-
Oct 1, 2014 4:14 PM in response to chimpskyby BobHarris,From the X/Open standards
open()
...
O_CREAT
If the file exists, this flag has no effect except as noted under O_EXCL below. Otherwise, the file shall be created; the user ID of the file shall be set to the effective user ID of the process; the group ID of the file shall be set to the group ID of the file's parent directory ...
-
Oct 1, 2014 10:02 PM in response to BobHarrisby chimpsky,Thanks for the reply... I'm kicking myself for not finding this explanation myself.
-
Jan 8, 2016 3:27 PM in response to chimpskyby basilmir,I think changin the umask will do exactly what you're after.
Umasks
The POSIX permissions on a file can be represented by a number with three digits. You might see permissions listed this way when viewing them from the Terminal. Each digit can be zero through seven. When you create a file, the umask value is subtracted from a default value (usually 666 for files, 777 for folders) to determine the permissions on the new file or folder.
For example, the default umask of 022 results in permissions of 644 on new files and 755 on new folders. Groups and other users can read the files and traverse the folders, but only the owner can make changes.
There are several different places where the umask can be set, each affecting different apps.
sudo launchctl config user umask nnn
See this: