Re:Byenow – A command-line Windows utility for faster folder...
by ptah on Thursday February 20, 2020 @05:54AM
(#22374163)
will it delete files even if open in another process? this is my main bugbear with windows file deletion: it won't delete it and you need special tools to track down the process that has the file open
[ Parent
| on HN ]
Re:Byenow – A command-line Windows utility for faster folder...
by apankrat on Thursday February 20, 2020 @06:21AM
(#22374265)
Depends on how they are opened.
If they aren't opened in FILE_SHARE_DELETE mode, then they will in fact be locked against deletion... because that's exactly what file's current user wanted. Force-deleting a file in this case is not the wisest thing to do.
[1] https://docs.microsoft.com/en-us/windows/win32/api/fileapi/n..., Ctrl-F for FILE_SHARE_DELETE
Re:Byenow – A command-line Windows utility for faster folder...
by pjmlp on Thursday February 20, 2020 @06:59AM
(#22374422)
Which is the right thing to do and the approach taken in all non-UNIX clones.
In any case, since ages one does not need special tools, resource monitor listing of open handles is enough.
Re:Byenow – A command-line Windows utility for faster folder...
by BubRoss on Thursday February 20, 2020 @08:23AM
(#22374870)
It's the right thing to give an error that some process has the file open but never tell you which process that is?
Re:Byenow – A command-line Windows utility for faster folder...
by latitude on Thursday February 20, 2020 @09:15AM
(#22375166)
That’s an UI issue with the tool.
The underlying behavior is correct though - people with open handles have the priority unless they have explicitly stated that deleting a file while they use it is OK.
Re:Byenow – A command-line Windows utility for faster folder...
by BubRoss on Thursday February 20, 2020 @12:49PM
(#22376930)
What tool? That's windows' behavior. I would agree that locking a file and preventing deletion is good or possibly queueing a file for deletion when it is free, but windows does not handle this scenario well.
Re:Byenow – A command-line Windows utility for faster folder...
by pjmlp on Thursday February 20, 2020 @08:55AM
(#22375059)
It might not be the most user-friendly way, but sure tops removing the file altogether.
Re:Byenow – A command-line Windows utility for faster folder...
by SAI_Peregrinus on Thursday February 20, 2020 @01:07PM
(#22377095)
A workaround to this is to use Process Explorer[1] to search for the filename, then kill the process that has a handle with that file name.
[1] https://docs.microsoft.com/en-us/sysinternals/downloads/proc...
Re:Byenow – A command-line Windows utility for faster folder...
by Ididntdothis on Thursday February 20, 2020 @10:08AM
(#22375546)
Telling you what process has a folder or file open should be added to windows explorer. It’s hard to explain why it isn’t.