Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TMP files in runtime directory
Message
From
17/03/2005 19:22:20
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
16/03/2005 14:51:41
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00996467
Message ID:
00997091
Views:
50
>If you want to get rid of them "automatically" you can start up your app from a batch file that does ERASE *.TMP on the folder in question before starting your app, or you can use ADIR() within VFP to get a list of all the .TMP files and *try* to delete each one individually (with an error handler in effect). You need to do it this way because while you're in VFP it will likely hold one or more of them legitimately open, so there are some you likely won't be able to delete.

I once had an app which ran in a bad network, so these files did crop up. During the shutdown, I'd create a dummy cursor and find the directory where the tempfiles were as cTempDir=justpath(dbf()). Then I'd kill the cursor, do an adir(a, forcepath("*.tmp", cTempDir)). Then I'd try to erase any such file that was older than two days. The two day delay was a rule-of-thumb measure as to how long can a stuck app stay loaded. And yes, internal error handling (or was it an attempt with fcreate(), maybe?) until it deleted all the files it could.

And I never really bothered to try to erase ALL the files that I could erase - new ones would be created every day, right? The point was to keep their number small enough.

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