Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting folders from sidebar fails if files in a sub directory were open #2403

Closed
deathaxe opened this issue Aug 15, 2018 · 18 comments
Closed

Comments

@deathaxe
Copy link
Collaborator

Summary

This issue report is the result of a discussion at https://forum.sublimetext.com/t/sublimetext3-cant-delete-folders-from-side-bar-on-windows-very-often

It looks like ST locks the folder of a file it opened on Windows OS. As a result the parent folder can't be moved to the recycle bin via SHShellFileOperation which is used by the send2trash python module. Deleting the folder via Windows Explorer fails, too.

SHShellFileOperation returns error code 120.

DE_ACCESSDENIEDSRC	0x78	Security settings denied access to the source.

Expected behavior

It should be possible to remove all (parent) folders even if a file within them is still open in a view. In many other cases if a file is deleted, the view still contains the content and marks the file modified. Same should happen if one of the parent folders is deleted - no matter which level.

Actual behavior

The following screen capture shows a command prompt script creating the folders and the xml/html files within the hlp folder. If none of the files is opened in a view, the whole folder tree starting with hlp can be deleted successfully.

animation

But as soon as one of the files was open in a view - even for preview only - the folder hlp can't be deleted directly. Neither by sidebar nor by Explorer.

animation_fehler

One must delete the folder which contains the open file manually (deu in this example). In worst case this means the whole folder tree needs to be deleted by picking each folder one after another by hand - depending on the previously open files.

Steps to reproduce

  1. Create a folder tree with at least 3 levels and put some files into the deepest folder (maybe per script)
    + folder 1
       + folder 2
          + folder 3
             - file.xml
    
  2. Add folder 1 to the sidebar of ST (vanilla install)
  3. Open file.xml
  4. Close file.xml
  5. Make sure the indexer is idle
  6. Try to delete folder 2 -> fails
  7. Now delete folder 3 -> works
  8. Delete folder 2 again -> works

Environment

  • Operating system and version:
    • Windows 10 Pro 1803 x64
  • Monitor:
    • Resolution 1900x1200
    • dpi_scale used in ST 1.0
  • Sublime Text:
    • Build 3176
    • 64 bit
@deathaxe
Copy link
Collaborator Author

I did some further investigation about it and it looks like there is an unclosed folder handle causing the issue.

What did I do?

Using ST vanilla install I added the TIM folder as in the screenshots above.

After indexer is done, the OpenFile and CloseFile operations of the folder are still in balance, so we can delete the folder. 5.665 opens/closes

screenshot_indexing

If I open one of the xml files and close it again SysInternals Procmon shows the following stats.

screenshot_opening

Looks like one directory handle is still open as CloseFile was not called for it. As a result the parent folder hlp can't be deleted.

@brupelo
Copy link

brupelo commented Aug 17, 2018

That's definitely interesting, in my case, I've arrived to this situation where a folder got locked, here's the unlocker report after making sure all external processes are not using this folder and also made sure the os.getcwd() in sublime_text python process is a different one (ie: os.chdir('c:\'))

showcase

And yeah, procmon will tell me the open/closes are not balanced:

showcase

Anyway, I'm trying to figure out how to use psutil to:

1.- Report the same information than the one provided by unlocker
2.- Figure out how to be able to unlock the folders... Ie: If I try to delete a folder in sublime_text and this is locked I wouldn't mind a confirmation dialog "This folder is being locked by XXX processes. Do you still want to delete it?".

Btw, one comment in the SO thread I've opened related to this issue pointed out that before deleting the folder would be convenient to level-up one directory before trying to delete the folder, that makes sense... although I've tried manually os.chdir and unlocker is still reporting me the folder being locked, so...

@brupelo
Copy link

brupelo commented Aug 17, 2018

Btw, thanks to bring up to the table procmon, it's a really interesting tool, it allows you to create really nice filters, so for instance, I'm having problems with that folder and sublime_text process, so I can export the csv such as:

"Time of Day","Process Name","PID","Operation","Path","Result","Detail"
"20:40:08,1913780","sublime_text.exe","7852","CreateFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Main.sublime-menu","SUCCESS","Desired Access: Generic Read, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"20:40:08,1914096","sublime_text.exe","7852","QueryStandardInformationFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Main.sublime-menu","SUCCESS","AllocationSize: 4.096, EndOfFile: 1.462, NumberOfLinks: 1, DeletePending: False, Directory: False"
"20:40:08,1914222","sublime_text.exe","7852","QueryBasicInformationFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Main.sublime-menu","SUCCESS","CreationTime: 17/08/2018 2:15:02, LastAccessTime: 17/08/2018 2:15:02, LastWriteTime: 17/08/2018 2:15:02, ChangeTime: 17/08/2018 2:15:02, FileAttributes: A"
"20:40:08,1914672","sublime_text.exe","7852","QueryOpen","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Main.sublime-menu","SUCCESS","CreationTime: 17/08/2018 2:15:02, LastAccessTime: 17/08/2018 2:15:02, LastWriteTime: 17/08/2018 2:15:02, ChangeTime: 17/08/2018 2:15:02, AllocationSize: 4.096, EndOfFile: 1.462, FileAttributes: A"
"20:40:08,1914850","sublime_text.exe","7852","CloseFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Main.sublime-menu","SUCCESS",""
"20:40:08,1914964","sublime_text.exe","7852","IRP_MJ_CLOSE","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Main.sublime-menu","SUCCESS",""
"20:33:27,1436704","sublime_text.exe","7852","CreateFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","SUCCESS","Desired Access: Generic Read, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"20:33:27,1437339","sublime_text.exe","7852","QueryStandardInformationFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","SUCCESS","AllocationSize: 160, EndOfFile: 153, NumberOfLinks: 1, DeletePending: False, Directory: False"
"20:33:27,1437469","sublime_text.exe","7852","QueryBasicInformationFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","SUCCESS","CreationTime: 17/08/2018 2:15:02, LastAccessTime: 17/08/2018 2:15:02, LastWriteTime: 17/08/2018 2:15:02, ChangeTime: 17/08/2018 2:15:02, FileAttributes: A"
"20:33:27,1437963","sublime_text.exe","7852","QueryOpen","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","SUCCESS","CreationTime: 17/08/2018 2:15:02, LastAccessTime: 17/08/2018 2:15:02, LastWriteTime: 17/08/2018 2:15:02, ChangeTime: 17/08/2018 2:15:02, AllocationSize: 160, EndOfFile: 153, FileAttributes: A"
"20:33:27,1438168","sublime_text.exe","7852","CloseFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","SUCCESS",""
"20:33:27,1438318","sublime_text.exe","7852","IRP_MJ_CLOSE","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","SUCCESS",""
"20:33:27,1438808","sublime_text.exe","7852","CreateFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","SUCCESS","Desired Access: Generic Read, Disposition: Open, Options: Sequential Access, Synchronous IO Non-Alert, Non-Directory File, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"20:33:27,1439948","sublime_text.exe","7852","ReadFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","SUCCESS","Offset: 0, Length: 153, Priority: Normal"
"20:33:27,1440284","sublime_text.exe","7852","ReadFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","SUCCESS","Offset: 0, Length: 153, I/O Flags: Non-cached, Paging I/O, Priority: Normal"
"20:33:27,1452711","sublime_text.exe","7852","ReadFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","END OF FILE","Offset: 153, Length: 32.768"
"20:33:27,1452877","sublime_text.exe","7852","CloseFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","SUCCESS",""
"20:33:29,1447907","sublime_text.exe","7852","CreateFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","SUCCESS","Desired Access: Read EA, Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"20:33:29,1448459","sublime_text.exe","7852","FileSystemControl","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","NOT REPARSE POINT","Control: FSCTL_GET_REPARSE_POINT"
"20:33:29,1448747","sublime_text.exe","7852","CloseFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","SUCCESS",""
"20:33:29,1448965","sublime_text.exe","7852","IRP_MJ_CLOSE","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","SUCCESS",""
"20:33:29,1452904","sublime_text.exe","7852","CreateFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender","SUCCESS","Desired Access: Read Data/List Directory, Read Attributes, Synchronize, Disposition: Open, Options: , Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"20:33:29,1453295","sublime_text.exe","7852","NotifyChangeDirectory","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender","","Filter: FILE_NOTIFY_CHANGE_FILE_NAME, FILE_NOTIFY_CHANGE_DIR_NAME, FILE_NOTIFY_CHANGE_ATTRIBUTES, FILE_NOTIFY_CHANGE_SIZE, FILE_NOTIFY_CHANGE_LAST_WRITE"
"20:33:29,1454542","sublime_text.exe","7852","CreateFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","SUCCESS","Desired Access: Generic Read, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"20:33:29,1454906","sublime_text.exe","7852","QueryStandardInformationFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","SUCCESS","AllocationSize: 160, EndOfFile: 153, NumberOfLinks: 1, DeletePending: False, Directory: False"
"20:33:29,1455083","sublime_text.exe","7852","QueryBasicInformationFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","SUCCESS","CreationTime: 17/08/2018 2:15:02, LastAccessTime: 17/08/2018 2:15:02, LastWriteTime: 17/08/2018 2:15:02, ChangeTime: 17/08/2018 2:15:02, FileAttributes: A"
"20:33:29,1455640","sublime_text.exe","7852","QueryOpen","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","SUCCESS","CreationTime: 17/08/2018 2:15:02, LastAccessTime: 17/08/2018 2:15:02, LastWriteTime: 17/08/2018 2:15:02, ChangeTime: 17/08/2018 2:15:02, AllocationSize: 160, EndOfFile: 153, FileAttributes: A"
"20:33:29,1455845","sublime_text.exe","7852","CloseFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","SUCCESS",""
"20:33:29,1456070","sublime_text.exe","7852","IRP_MJ_CLOSE","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","SUCCESS",""
"20:33:32,4117069","sublime_text.exe","7852","CreateFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","SUCCESS","Desired Access: Generic Read, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"20:33:32,4117365","sublime_text.exe","7852","QueryStandardInformationFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","SUCCESS","AllocationSize: 160, EndOfFile: 153, NumberOfLinks: 1, DeletePending: False, Directory: False"
"20:33:32,4117479","sublime_text.exe","7852","QueryBasicInformationFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","SUCCESS","CreationTime: 17/08/2018 2:15:02, LastAccessTime: 17/08/2018 2:15:02, LastWriteTime: 17/08/2018 2:15:02, ChangeTime: 17/08/2018 2:15:02, FileAttributes: A"
"20:33:32,4117933","sublime_text.exe","7852","QueryOpen","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","SUCCESS","CreationTime: 17/08/2018 2:15:02, LastAccessTime: 17/08/2018 2:15:02, LastWriteTime: 17/08/2018 2:15:02, ChangeTime: 17/08/2018 2:15:02, AllocationSize: 160, EndOfFile: 153, FileAttributes: A"
"20:33:32,4118103","sublime_text.exe","7852","CloseFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","SUCCESS",""
"20:33:32,4118221","sublime_text.exe","7852","IRP_MJ_CLOSE","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Default (Linux).sublime-keymap","SUCCESS",""
"20:34:58,8323514","sublime_text.exe","7852","CreateFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Main.sublime-menu","SUCCESS","Desired Access: Generic Read, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"20:34:58,8323992","sublime_text.exe","7852","QueryStandardInformationFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Main.sublime-menu","SUCCESS","AllocationSize: 4.096, EndOfFile: 1.462, NumberOfLinks: 1, DeletePending: False, Directory: False"
"20:34:58,8324118","sublime_text.exe","7852","QueryBasicInformationFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Main.sublime-menu","SUCCESS","CreationTime: 17/08/2018 2:15:02, LastAccessTime: 17/08/2018 2:15:02, LastWriteTime: 17/08/2018 2:15:02, ChangeTime: 17/08/2018 2:15:02, FileAttributes: A"
"20:34:58,8324714","sublime_text.exe","7852","QueryOpen","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Main.sublime-menu","SUCCESS","CreationTime: 17/08/2018 2:15:02, LastAccessTime: 17/08/2018 2:15:02, LastWriteTime: 17/08/2018 2:15:02, ChangeTime: 17/08/2018 2:15:02, AllocationSize: 4.096, EndOfFile: 1.462, FileAttributes: A"
"20:34:58,8324915","sublime_text.exe","7852","CloseFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Main.sublime-menu","SUCCESS",""
"20:34:58,8325050","sublime_text.exe","7852","IRP_MJ_CLOSE","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Main.sublime-menu","SUCCESS",""
"20:34:58,8325559","sublime_text.exe","7852","CreateFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Main.sublime-menu","SUCCESS","Desired Access: Generic Read, Disposition: Open, Options: Sequential Access, Synchronous IO Non-Alert, Non-Directory File, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"20:34:58,8326159","sublime_text.exe","7852","ReadFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Main.sublime-menu","SUCCESS","Offset: 0, Length: 1.462, Priority: Normal"
"20:34:58,8720412","sublime_text.exe","7852","ReadFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Main.sublime-menu","END OF FILE","Offset: 1.462, Length: 32.768"
"20:34:58,8720589","sublime_text.exe","7852","CloseFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Main.sublime-menu","SUCCESS",""
"20:35:00,8403104","sublime_text.exe","7852","CreateFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Main.sublime-menu","SUCCESS","Desired Access: Read EA, Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"20:35:00,8403547","sublime_text.exe","7852","FileSystemControl","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Main.sublime-menu","NOT REPARSE POINT","Control: FSCTL_GET_REPARSE_POINT"
"20:35:00,8403748","sublime_text.exe","7852","CloseFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Main.sublime-menu","SUCCESS",""
"20:35:00,8403878","sublime_text.exe","7852","IRP_MJ_CLOSE","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Main.sublime-menu","SUCCESS",""
"20:35:00,8405311","sublime_text.exe","7852","CreateFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender","SUCCESS","Desired Access: Read Data/List Directory, Read Attributes, Synchronize, Disposition: Open, Options: , Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"20:35:00,8405619","sublime_text.exe","7852","NotifyChangeDirectory","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender","","Filter: FILE_NOTIFY_CHANGE_FILE_NAME, FILE_NOTIFY_CHANGE_DIR_NAME, FILE_NOTIFY_CHANGE_ATTRIBUTES, FILE_NOTIFY_CHANGE_SIZE, FILE_NOTIFY_CHANGE_LAST_WRITE"
"20:35:00,8406472","sublime_text.exe","7852","CreateFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Main.sublime-menu","SUCCESS","Desired Access: Generic Read, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"20:35:00,8406724","sublime_text.exe","7852","QueryStandardInformationFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Main.sublime-menu","SUCCESS","AllocationSize: 4.096, EndOfFile: 1.462, NumberOfLinks: 1, DeletePending: False, Directory: False"
"20:35:00,8406839","sublime_text.exe","7852","QueryBasicInformationFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Main.sublime-menu","SUCCESS","CreationTime: 17/08/2018 2:15:02, LastAccessTime: 17/08/2018 2:15:02, LastWriteTime: 17/08/2018 2:15:02, ChangeTime: 17/08/2018 2:15:02, FileAttributes: A"
"20:35:00,8407257","sublime_text.exe","7852","QueryOpen","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Main.sublime-menu","SUCCESS","CreationTime: 17/08/2018 2:15:02, LastAccessTime: 17/08/2018 2:15:02, LastWriteTime: 17/08/2018 2:15:02, ChangeTime: 17/08/2018 2:15:02, AllocationSize: 4.096, EndOfFile: 1.462, FileAttributes: A"
"20:35:00,8407419","sublime_text.exe","7852","CloseFile","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Main.sublime-menu","SUCCESS",""
"20:35:00,8407526","sublime_text.exe","7852","IRP_MJ_CLOSE","D:\sources\personal\sublimetext3\Data\Packages\SublimeBlender\Main.sublime-menu","SUCCESS",""

Which is cool, but I'm still trying to figure out how to get more information about the "handles" reported by unlocker, that's the really interesting stuff here to know which part of the processs has locked the file/folders... :)

@deathaxe
Copy link
Collaborator Author

The SysInternals Progcess Explorer shows the number of open handles per app, too. I saw the number of open handles constantly increasing in ST after each file open operation. Unfortunately it doesn't tell much about the type of handles not being closed anymore. Maybe files, maybe other controls.

@brupelo
Copy link

brupelo commented Aug 22, 2018

posted a partial solution on the forum, I did so in case will reach more people interested on this issue

@jamesdolan
Copy link

I am encountering this as well on Windows and its quite annoying. I can't even git-clean sometimes without first exiting Sublime due to it leaking file handles. Any word on a proper fix?

@brupelo
Copy link

brupelo commented Sep 15, 2018

The best way I can think of would be having a background service or web_server running in non-visible mode with admin privileges, such service would allow you to unlock folders. You'd need to run this service at startup so it wouldn't prompt the UAC dialog. Why admin mode? Well, if you want to unlock folder/processes you definitely need admin privileges to do, so either you run ST3 as admin or even worst, you run ST as normal user and make your code to prompt the UAC elevation privileges dialog, this last would be really annoying cos this UAC dialog would bother you over and over each time you wanted to unlock folders.

Of course, the above proposal is not ideal (if you were coding a service) cos as you know, writing windows/mac/nix services is non-portable stuff, you'd end up having a non-portable solution. So yeah, I understand why ST core devs didn't put any effort on this issue... guess was mainly because it needs admin requirements, that would bother end-users at the end of the day... or maybe they didn't give a ... who knows :)

Ps. But yeah, I do agree with you, this limitation is really annoying. Said otherwise, can't you delete folders? So why are you providing your users with a mediocre solution such as "Delete Folder"... if you're providing uncomplete solutions it's better don't ship them at all. Easy peasy :/

@dubeg
Copy link

dubeg commented Oct 29, 2018

The issue still exists in build 3180. It seems the bug appeared in build 3175/3176?
I'll revert to 3174 today and see how it goes.

@dubeg
Copy link

dubeg commented Nov 21, 2018

It seems it exists in 3174. I'll try 3173.

@MrButlerTron
Copy link

I think I am seeing this build 3176, with opening a file on usb storage, closing the file, and then SublimeText still has an open handle on the folder the file was in. I'm not even opening the entire folder in SublimeText.

It may be related to where Sublime Text expects the File->Open dialog to start at, but it seems like bad behavior.

I currently have to use ProcessExplorer to kill the specific handle OR completely close SublimeText.

@christinaa
Copy link

I wish this issue got addressed, had to abandon Sublime Text 3 because of it and because of issued caused by forcefully closing file handles. Some repositories are huge with millions of files, having to restart Sublime Text because it decided to lock a file that is not open in any way makes for an extremely frustrating experience, having this happen several times per day, just by viewing a file (with indexing and everything else off) and trying to rename the directory afterwards only to get an error got to a point where it was practically ridiculous.

@deathaxe
Copy link
Collaborator Author

deathaxe commented Feb 2, 2019

This issue is fixed in ST 3189

@deathaxe deathaxe closed this as completed Feb 2, 2019
@FichteFoll FichteFoll added this to the Build 3189 milestone Feb 7, 2019
@ghost
Copy link

ghost commented Apr 26, 2020

Bug is still there (build 3211) Windows 10.

@brupelo
Copy link

brupelo commented Apr 27, 2020

This issue has never been fixed properly... i recall when we were discussing about it few months ago i'd created some little tcp server so when some folder couldn't be deleted sublime send some request to it to unlock the folder... but it was a pain in the ass to run it, admin rights, etc...

This has been a really pita of sublime for ages... deleting folders is really challenging... I don't understand why you said has been fixed in 3189... the bug still remains in (build 3211) windows7...

@deathaxe
Copy link
Collaborator Author

This issue is about opening a file in ST causing the containing folder(s) to be locked by Windows forever - most likely because of leaking file handles - which caused OSError 120 when trying to delete one of the parent folders.

This was a painful issue in ST3176 which is definitly fixed.

ST of course has no control about other applications locking files and folders.

What you might most likely be running into with build 3211 is #3124

@brupelo
Copy link

brupelo commented Apr 27, 2020

@deathaxe Oh, ok... I didn't know that... in my previous comment maybe i've extracted conclusions too fast, so sorry about misleading there. And yeah, thanks to reference the other issue here. I'll be definitely paying attention from now that's certainly the case.

@ghost
Copy link

ghost commented Apr 27, 2020

You can't say that it is fixed, the original issue might have been fixed however you should note that show_git_status is enabled by default which leads us to the same result; folders being locked. That is unless you're not dealing with a git repository. Unfortunately I will have to disable it if it proves to be the issue there.

@wbond
Copy link
Member

wbond commented Apr 27, 2020

This issue was fixed. A similar but distinct bug affects some users.

It doesn’t help anyone to keep any bug with a similar symptom open until every bug is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants