Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Random file use error?
Message
From
24/01/2014 05:05:40
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
23/01/2014 19:51:06
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01592361
Message ID:
01592369
Views:
62
>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
* 4/9/2001 dragan
	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

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform