I'm getting DELETE PENDING errors intermittently when my program deletes a file and then quickly thereafter creates a new file with the same path as the deleted file. In the Dyalog APL session window, it's reported as FILE ACCESS ERROR. I can re-create the error with Dyalog APL 16.0.35389.0 32 Classic on Windows Server 2012 R2 running on VMWare, but not on a bare-metal Windows 10 install. Here's a minimal code example that triggers the error:
:Namespace DeletePending
∇ main nTimes;filename;i
:For i :In ⍳nTimes
filename←'c:\tmp\delete_pending_dummy.txt'
(⊂'one' 'two')⎕NPUT filename 1
filename ⎕NERASE filename ⎕NTIE 0
:EndFor
∇
:EndNamespace
Attached is a screenshot showing the DELETE PENDING error in procmon (Sysinterals).
On my VMWare Windows install, I need to run at least 100 iterations of the loop in the main
function (see the DeletePending namespace script above) to trigger the error. As far as I can tell, I'm using ⎕NPUT and ⎕NERASE correctly -- can someone tell me what's wrong?
What I've tried already (summary): creating and erasing a file in a loop, single thread; did not expect intermittent FILE ACCESS ERROR.