Click to See Complete Forum and Search --> : Deleting files in VB


Ravi Sangisetti
June 2nd, 1999, 01:24 PM
I want to delete some files based on some criteria.

I am using Dir() command to get the file name. I am checking the file name and deleting that file by Kill statement. But I can not use Dir() statement recursively.

1. Can U suggest optimized code for writing all the filenames in a directory into array.

Can I give a file some life time?. I mean to ask is when we create a file, Is there any option to delete it automatically after exactly a month.



I expect help from all U code gurus,

Ravi Sangisetti
Sr.Software Engineer
Contech India Ltd
Gandinagar, India

Rob
June 3rd, 1999, 08:33 PM
Instead of using the VB Dir command, I suggest that you use the FindFirstFile and FindNextFile windows API calls. These work similiar to the Dir command, but they have the added benefit of being recursive.

rob
June 3rd, 1999, 08:33 PM
Instead of using the VB Dir command, I suggest that you use the FindFirstFile and FindNextFile windows API calls. These work similiar to the Dir command, but they have the added benefit of being recursive.