bcharbonnier / SublimeFileSync

Sublime Text 2 FileSync plugin
44 stars 10 forks source link

File permission on copy #10

Closed piuccio closed 5 years ago

piuccio commented 11 years ago

I think this comes from an issue in Sublime itself.

If you open a read-only file and try to save, the plugin still receives the on_post_save although the file was not modified. Now since the plugin is using shutil.copy2 a read-only file is copied in the destination folder.

If then you remove the read-only flag on the source file you won't be able to sync this file anymore until you remove the read-only flag from the destination.

I don't know what's the best option here, maybe copy the file without permission using copyfile

bcharbonnier commented 11 years ago

Interesting issue. I'll have a look at it and maybe just change for copyfile as you suggested