Well, just in case any of you has the same problem … I’ve done a plug-in that does the trick:
import sublime, sublime_plugin
import os, stat
class ForceSaveCommand(sublime_plugin.WindowCommand):
def run( self ):
myFile = self.window.active_view().file_name()
fileAtt = os.stat(myFile)[0]
myPlatform = os.name
if (myPlatform == 'nt'):
if (not fileAtt & stat.S_IWRITE):
print "Making "+myFile+" writable"
os.chmod(myFile, stat.S_SIWRITE)
else:
if (fileAtt & stat.UF_IMMUTABLE):
print "Making "+myFile+" mutable"
os.chflags(myFile, not stat.UF_IMMUTABLE)
self.window.active_view().run_command('save')
Then create a User Key Binding that supersedes the global save shortcut:
MacOS
{ "keys": "super+s"], "command":"force_save"}
Windows
{ "keys": "ctrl+s"], "command":"force_save"}
It works for both Windows XP and MacOS.