Os.mkdir rights assignment does not work properly

I am trying to create a directory with 777 permissions.

os.mkdir(Xmldocument.directory, 0777) 

However i get 775

 drwxrwxr-x. 2 mwysoki mwysoki 4096 Nov 9 11:38 VeloDBBrowser 

I am sure that I have the appropriate rights, because chmod 777 works fine.

+7
source share
1 answer

The current umask is also applied here.

Typically, files are created using 0777 (if the executable or directory) or 0666 (other files.)

The OS then applies the current umask to this value, which results in 0755 resp. 0644 visible on most files, since the most common umask is 0022 .

Your solution would be to set umask to 0 .

+7
source

All Articles