Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Slow to delete files
Message
De
23/10/2012 09:22:44
 
 
À
23/10/2012 09:05:43
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01555512
Message ID:
01555534
Vues:
47
>>This part of the app is a simple document management system based upon the creation and storage of pdfs for. When creating a pdf for viewing only the pdf file is created in a temporary folder; when storing the pdf the temporary file is then copied to the network and the temporary file deleted. It is this last step that is taking longer on W7clients compared to XPclients.
>
>My strategy for cleaning up the temp folder is to delete the files later, but then delete all of them that I can delete. I do this by running a little purge routine at the app's exit, where I delete anything older than three days. By that time, any app that's still holding some of the files open (like your browser, or mailer or who knows what things we keep open for days) will of course cause an error - but I ignore all such errors. OTOH, any app that's created a temp file with the intention to use it within the current session, is not going to keep the file for three days and then use it, or creates a subdirectory and keeps its files there.

I did something similar on my old website. Whenever I needed to create a temp file, I first deleted all files in the temp folder which were older than two days.

>This keeps the temp folder manageably small (thus no phone calls about running out of space on C: drive, a big plus), no app complains about missing files, leftover files from crashed apps don't pile up (specially nice for programmer's machines), and I occasionally get a chance to look into these files before they are deleted, just in case I need to check something - I don't have to add debug lines to salvage the file before it's deleted (and then forget to remove them).
>
>And, BTW, I also have a PDF generator app somewhere, and I had to write a loop to check the length of the file every 100ms (using sleep()) to see if the file is still growing. Once it stops growing, I assume the engine which creates it is finished and then I can go on.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform