Sublime Text 3 changes file permissions on save

2

I have bunch of files with permissions -rwxrwxr-- www-data www-data. In order to be able to edit them, I added my user to the www-data group. Now when I edit and save file with Sublime Text 3, the ownership changes to my user/group. Gedit editor supplied with distro (Linux Mint 16) works fine.

How do I get Sublime Text to keep permissions intact?

user210672

Posted 2014-05-09T13:50:02.817

Reputation: 41

There is a post with similar issues for ST2: http://stackoverflow.com/questions/11853429/how-to-stop-sublime-text-2-from-removing-the-read-execute-flag-upon-save

– Bruno9779 – 2014-05-09T14:28:46.870

@Bruno9779: thanks, but the problem/solution in that question is related to Samba – user210672 – 2014-05-09T14:44:18.693

Answers

2

Found solution here: https://stackoverflow.com/questions/20634684/what-is-sublime-text-doing-when-i-save-a-file

Adding "atomic_save": false to user settings file solves the problem (new files however are still created with my user group as the owner).

user210672

Posted 2014-05-09T13:50:02.817

Reputation: 41

this didn't solve the problem, im using dev channel build 3095. and it adds x permissions to the file I save. I am coding in windows and the files are being accessed through samba – kapitanluffy – 2015-11-04T02:13:15.277

Glad my answer could help you out, I'll have to add your issue to the list of those caused by atomic_save. In regards to your other issue, it's not surprising at all that new files are created with your UID/GID, as that is the ownership that Sublime is running with. If you're into Python, it shouldn't be too difficult to write a plugin to check if you're trying to save into a particular file hierarchy, then change the user and group of the file after saving, assuming you can do that yourself from the command line without using sudo. – MattDMo – 2014-05-11T05:16:52.810

0

I was facing same issue on ubuntu and used below commands to give save permission

sudo chmod 775 -R /var/www/folder_path 

sudo chown username -R /var/www/folder_path

please note: /var/www/folder_path is your project folder path or directory where you want to save file.

BSB

Posted 2014-05-09T13:50:02.817

Reputation: 101