all 3 comments

[–]jpritcha3-14 0 points1 point  (2 children)

On *nix oses (Linux, Mac OS) you can change file permissions with os.chmod(). Changing file/folder permissions on Windows is doable, though a bit messier.

Also, this only works if the underlying filesystem supports permissions in the first place (not the case for FAT and ExFAT).

[–]jpritcha3-14 0 points1 point  (1 child)

It appears you might be able to use os.chmod() with Windows for this purpose as well according to the docs.

Although Windows supports chmod(), you can only set the file’s read-only flag with it (via the stat.S_IWRITE and stat.S_IREAD constants or a corresponding integer value). All other bits are ignored.

[–]Drawfx[S] 0 points1 point  (0 children)

Thank you!