>I've seen cases of strange behaviour when the local temp file folder has thousands of dead/orphan files. This can easily happen when a computer is used for several years and the folder has never been cleaned out. A PACK operation makes extra heavy use of temp files; this could be a factor. Maybe file-name collision, poor disk performance, ...
For that, I wrote this bit, which I call from the shutdown procedure, part of the cleanup on exit. Note the date (set to American).
PROCEDURE PurgeTemp
lcDir=SYS(2023)
IF NOT DIRE(lcDir)
RETURN
ENDIF
lcOnErr=ON('error')
ON ERROR *
LOCAL ldDay, lcFSpec, i, j, fname
ldDay=DATE()-3
lcFSpec=FORCEPATH('*.*', lcDir)
N=ADIR(aa, lcFSpec)
FOR i=1 TO N
IF aa[i,3]<ldDay
ERASE (FORCEPATH(aa[i,1], lcDir))
ENDIF
ENDFOR
ON ERROR &lcOnErr