haxe-sublime-bundle icon indicating copy to clipboard operation
haxe-sublime-bundle copied to clipboard

TMP files stick around if the original file was read-only (save_temp_file)

Open emr4378 opened this issue 10 years ago • 0 comments

When edited files are temporarily saved off the file permissions are copied onto the temp file as well. If the original file was read-only the temp file can no longer be deleted (and the original file can't be written to, but this was happening first).

Since I'm using Perforce for source control and files are read-only until explicitly checked out this results in a bunch of *.tmp files cluttering up my project. The following is also spit out:

Traceback (most recent call last): File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 543, in run_ return self.run(edit, **args) File "C:\Users\CheEsus\AppData\Roaming\Sublime Text 3\Packages\Haxe\HaxeComplete.py", line 414, in run comps, hints = complete.get_haxe_completions( self.view , r.end() ) File "C:\Users\CheEsus\AppData\Roaming\Sublime Text 3\Packages\Haxe\HaxeComplete.py", line 1914, in get_haxe_completions temp = self.save_temp_file( view ) File "C:\Users\CheEsus\AppData\Roaming\Sublime Text 3\Packages\Haxe\HaxeComplete.py", line 1790, in save_temp_file shutil.copy2( fn , temp ) File "./shutil.py", line 243, in copy2 File "./shutil.py", line 110, in copyfile PermissionError: [Errno 13] Permission denied: 'C:\Users\CheEsus\Perforce\TestTest\source\PlayState.hx.tmp'

emr4378 avatar Nov 27 '14 04:11 emr4378