Unlinking Files on Windows
This page is intended for developers.
Normally, Python's 'os.unlink(f)' deletes the file f.
On Windows, if f has been opened for reading by another process with 'posixfile(f)', calling unlink will send that file into a "scheduled delete" state.
Scheduled delete has the following characteristics:
- (a) the entry in the directory for f is still kept
(b) calling 'fd = posixfile(f, 'w')' will raise 'IOError: [Errno 13] <f>: Access is denied'
Scheduled delete is left as soon as the other process closes the file.