Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Delete Folders created prior to some date
Message
From
26/10/2005 22:15:19
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01003065
Message ID:
01062493
Views:
17
>>VFP6 I have code to delete all the files in a folder greater than some number of days ago. But I also want to delete the folders that were created > than some number of days ago. How to do?
>>
>>
>>arraynum=ADIR(aTemps,ctables)
>>FOR i = 1 TO arraynum
>>   if atemps(i,3)+20 < DATE()	&& last modified date was over 20 days ago
>>	   cFile=aTemps(i,1)
>>	   DELETE FILE (cpath+cFile)
>>   endif	
>>ENDFOR
>>
>
>Anybody come up with an answer for this. Just looking at my code and I have not solved this problem yet.

Well, in the case of the folders, you will have to use (for example) rmdir instead of delete file.

Or what is it that doesn't work?
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)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform