Sublime Forum

Bug when saving files on a Samba shared drive

#1

I was having a problem with saving files on a Samba shared drive. The permissions on the saved file is different from the original version. After going through [1] and the problem persisted, I experimented a little and think I found where the problem is.

The issue is with the “atomic_save” feature. What it does, if I am assuming correctly from the documentation, is that it creates a new file with the default create permissions specified in Samba, and replaces the existing file with the new file. However, in doing so, it fails to replicate the permissions of the old file. One solution might be to chmod / setattr immediately after creating the new file, then replace the existing file with the new file.

I surmise other Shared Folders or NFS solutions which set default permissions on newly created files might have this issue as well.

[1] viewtopic.php?f=3&t=7969&start=0

0 Likes