httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe Jr." <wr...@rowe-clan.net>
Subject Re: disk cache file rename errors on Windows
Date Thu, 02 Dec 2010 19:06:24 GMT
On 12/2/2010 11:23 AM, Graham Leggett wrote:
> 
> Does Windows allow you to move a file into place while the replaced file is still open
for
> read?

This is illustrative of Win32 limitations;

"The DeleteFile function fails if an application attempts to delete a file that is open
for normal I/O or as a memory-mapped file.

The DeleteFile function marks a file for deletion on close. Therefore, the file deletion
does not occur until the last handle to the file is closed. Subsequent calls to CreateFile
to open the file fail with ERROR_ACCESS_DENIED."

Which is to say, unlink/rename or rename-over-existing would have the same net behavior,
and the same failure case.

Mime
View raw message