Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you delete oldest Directories?
Message
De
12/05/2009 02:36:18
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01399335
Message ID:
01399336
Vues:
73
You can use ADIR() to find all the directories, use the D switch to only get the directories.
lnNumberOf Directories=adir(laDir,'c:\temp','D')
Then you use asort() to find the oldest directory. Check message#1399322 to see how to remove a directory.

>I have programmed a backup of current databases into dated Directories - for example (FX_May15) (FX_May2)
>What i would like to do is limit the number of backups to 10 and delete the oldest directories.
>
>Can someone help me out here. All i have to go on is code to count files. Added problem is that VFP9 will not delete directories that contain files.
>
>Code for counting files
>lnFileCount = Adir(laFiles, "C:\temp\*.dbf")
>If lnFileCount > 10
>????
>endif
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform