3 ms·
> Windows won't let you delete a file that's still in use, so this scenario can't happen. Windows lets you delete files which are open all you want, and Window
by naikrovek 6y ago
> Windows won't let you delete a file that's still in use, so this scenario can't happen.
Windows lets you delete files which are open all you want, and Windows also lets the application which opens the file prevent that. A lot of things like this are blamed on Windows when it's actually Windows providing options to the application developer, and the application developer choosing to take advantage of options like that when they don't need to.
see: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-lockfileex https://docs.microsoft.com/en-us/windows/win32/api/fileapi/n... and note in the left side nav that reading, writing, and locking are all separate operations.
(This is a common misconception that I wanted to clear up, and isn't super relevant to the topic at hand.)