[issue15244] Support for opening files with FILE_SHARE_DELETE on Windows

Eryk Sun report at bugs.python.org
Fri Mar 12 18:13:50 EST 2021


Eryk Sun <eryksun at gmail.com> added the comment:

Deleting a file in Windows 10 has been updated to try a POSIX-style delete. For a POSIX delete, the filesystem unlinks the file even it's open, whereas a classic delete only unlinks a 'deleted' file when it's closed. The filesystem has to support it. NTFS does, which is the most important because the system drive is NTFS. This makes supporting FILE_SHARE_DELETE a more attractive option. 

That said, there are sill significant limits. Memory-mapped files can't be deleted (renamed, yes, but not removed). Also, most programs don't share delete access on their opens, which means they can't open a file that's currently open with delete access (e.g. NamedTemporaryFile), and their open files can't be deleted.

----------
components: +IO, Windows -Library (Lib)
nosy: +paul.moore
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue15244>
_______________________________________


More information about the Python-bugs-list mailing list