Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Temp files cleanup
Message
De
24/09/2003 21:55:24
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
24/09/2003 21:52:16
John Tomblin
Service Station Systems, Inc.
San Jose, Californie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00832068
Message ID:
00832069
Vues:
20
Two ideas which you might want to experiment with.

1) Try to indicate the full path with adir(). You can get the current directory, including disk letter, with fullpath("").

2) To avoid problems, don't try to erase a temp file if it was created today.

>Foxpro is not very effective at cleaning up temp files. The temp files folder acquires more and more files over time. I have written a proc to clean up the temp folder upon entering my app. It looks like this:
>
>ApprDir = sys(5) + curdir()
>Tempdir = sys(2023)
>cd (TempDir)
>FileCnt =adir(Temps)
>on error X = .T.
>
>for Ctr = 1 to FileCnt
> erase (Temps[Ctr, 1])
>endfor
>
>cd (AppDir)
>
>The "on error" line is just to prevent the display of errors if a file is in use. This code does not work. I am always left in the temp folder not the application folder.
>
>Any ideas?
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform