How to stop Sublime Text 2 from removing the Read & Execute flag while saving

Using Sublime Text 2, I sometimes have to edit shell files that are executed by bash in cron. However, when I save these files, the execution flag is removed from the file, which causes cron to fail when trying to execute the file. I have to chmod the file every time I change it. Previously, using Ultra-Edit, I never had this problem.

Has anyone else dealt with this problem, who can recommend a fix or solution?

+6
source share
2 answers

This issue can be fixed by disabling the map_archive samba function.

 [global] map archive = no 

This should solve the problem.

A source

+10
source

Assuming you are editing files through Samba, Sublime Text seems to recreate the file every time it saves it, with the default umask and does not preserve old permissions.

The workaround to get + x permissions is to install

 create mask = 755 

in your smb.conf Samba file in the appropriate section section.

On the other hand, each new file will now have + x.

+1
source

Source: https://habr.com/ru/post/922318/


All Articles