On Thu, Dec 2, 2010 at 12:23 PM, Graham Leggett <minf...@sharp.fm> wrote:
> On 23 Nov 2010, at 8:21 PM, Dan Poirier wrote:
>
>> We're seeing errors like this from mod_disk_cache on Windows only:
>>
>> (OS 5)Access is denied.  : disk_cache: rename tempfile to datafile
>> failed: c:/temp/HTTPServer7/aptmpV0JKJ8 ->
>> c:/temp/HTTPServer7/wHY/FhW/b...@muvttlk@V4w.data
>>
>> under moderate to heavy load, resulting in requests failing.
>
> Looking at the code, the error message is thrown when apr_file_rename()
> fails, specifically when a temporary file is swung into place in the cache.
>
> Looking at the APR code, there is a forest of ifdefs that seem to choose one
> of MoveFileEx(), MoveFileW(), MoveFileExW() or MoveFile(). Ideally, the
> Microsoft API documentation should explain under what conditions the error
> "Access is denied" is thrown.
>
> Does Windows allow you to move a file into place while the replaced file is
> still open for read?

Disclaimer: My last real Windows programming was on WfW 3.11, so
please, someone with up-to-date Windows programming experience correct
me as needed.

>From the doc for MoveFileEx
(http://msdn.microsoft.com/en-us/library/aa365240%28VS.85%29.aspx),
you can pass a flag telling Windows to do the move on the next reboot
(also see http://support.microsoft.com/kb/140570) , apparently to work
around an inability to rename another file over a file in use.  So I
think the answer to your question is "no".

The doc for error 0x05 at
http://msdn.microsoft.com/en-us/library/ms681382%28v=VS.85%29.aspx
consists, in its entirety, of "Access is denied.".  Maybe there's more
explanation elsewhere.

-- 
Dan Poirier
<poir...@pobox.com>

Reply via email to