Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TMP files in runtime directory
Message
De
16/03/2005 14:51:41
 
 
À
16/03/2005 14:27:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Database:
Visual FoxPro
Divers
Thread ID:
00996467
Message ID:
00996481
Vues:
246
>Folks,
>
>I'm having trouble at one of my client sites. When they run our foxpro application, for some reason, there are a number of *.TMP files that get created in the runtime directory of the application. And, for some reason, after a while (after a couple thousand of these files get created) PACK statements start failing, and the only recourse is to either suggest that the user smoke these files or re-install the applciation.
>
>Questions:
>a) What are these .tmp file (I'm assuming it's how foxpro handles its cursors) - has to create a file of some-sort.
>b) Why are they getting created in the run-time directory
>c) Is there any way to get rid of these files? Or, to configure foxpro in such a way that it looks after it's own garbage collection - as these files certainly files that I intentionally created.

.TMP files are created by VFP for a number of reasons, including (in some cases, but not always) creating cursors. VFP will usually delete them automatically when it shuts down. If the VFP app closes unexpectedly (e.g. C5, terminated via Task Manager, computer powered off while program still active) these files will be left hanging around.

I know of only one way that .TMP files build up without abnormal .VFP shutdown: Re: Tip o' the Day: ALTER TABLE on a Cursor Thread #476591 Message #476816

You can control where they go by specifying TMPFILES=(some path) in a CONFIG.FPW file you include (bind into) your .EXE. If you haven't done that, applications usually use the Windows TEMP folder specified by the environment variables TEMP and TMP. Assuming your app isn't installed in the TEMP folder it's a bit of a question why they're showing up there.

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.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform