Jun-15-2023, 09:41 AM
(This post was last modified: Jun-15-2023, 09:41 AM by Gribouillis.)
(Jun-15-2023, 07:47 AM)SpongeB0B Wrote: Should not only display the umask but also set it !?I just wanted to show the default value of the umask on my system. I chose the value 0 at random. Choose the value that you actually need for your file operation.
In the linux console, the current umask can also be displayed by invoking the umask command without argument
Output:λ umask
0002
You could perhaps tryos.umask(os.umask(0) & ~(0o005))to make sure that the umask does not prevent the "others" permission 5, or even
os.umask(os.umask(0) & ~(0o0755))to make sure that the umask doesn't disallow the mode 0755