Note that there are some explanatory texts on larger screens.

plurals
  1. POwhen CreateDirectory returns ERROR_ACCESS_DENIED and "shouldn't"
    primarykey
    data
    text
    <p>My Win32 app A1 (actually a collection of processes) is trying to use <code>CreateDirectory</code> to create a directory D1 within parent directory P. The path to P is the value of the <code>TMP</code> environment variable, which makes P a potentially busy but generally permissive place. The vast majority of the time, everything works fine, but, rarely, <code>CreateDirectory</code> fails and <code>GetLastError</code> then returns <code>ERROR_ACCESS_DENIED</code>, the meaning of which in this context is not documented.</p> <p>I wrote a test application A2 which does nothing but repeatedly create and delete a directory D2 as fast as it can within P, and I chose a goofy long name for D2 which I'm confident does not collide with any that any other program would use. Once every few minutes, there's a small fraction of a second during which A2's attempts to create D2 yield only <code>ERROR_ACCESS_DENIED</code> failures.</p> <p>A1 gets quite busy within P during its run. While A1 and A2 are running concurrently, the periods of <code>ERROR_ACCESS_DENIED</code> failure occur somewhat more frequently, as if A1 and A2 are competing for exclusive access to P. (I am absolutely certain that A1 does not use the same name as D2. :-)</p> <p>I'm somewhat inclined to take <code>ERROR_ACCESS_DENIED</code> to mean "try again in a few milliseconds, and if that doesn't work after a few tries, give up", but I'm concerned that [a] in some cases it may mean something permanent that I should heed right away, and [b] because I don't really know what's happening, it may not be possible to confidently establish a reasonable amount of time to keep trying.</p> <p>Anybody have experience with this? Any advice? Of particular value at this point would be clues about what causes this so I can reproduce the problem more easily.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload