Tag Info

New answers tagged

0

As suggested in my question, it was a server-side change that needed making. I added these lines to /etc/smb.conf on the server: create mask = 0666 force create mode = 0666 directory mask = 0777 force directory mode = 0777 And now it works fabulously.


1

When you run umask with system it runs in a shell: umask changes the mask of that shell, but the shell then immediately terminates and the change is lost. To change the umask of your Python process, use os.umask(), which will: Set the current numeric umask and return the previous umask. That way the change will be made to your running program, rather ...


1

This is perfectly normal behaviour, but probably not what you intend. The umask 055 settings are there for the duration of the os.system call, so they never change the settings for the Python script, and certainly not for the command called in the next os.system() call. What you should do is something like: import os old_mask = os.umask(055) ...



Top 50 recent answers are included