Hi,
I'm wondering which file the FileList("USR",fileName(1)) instruction will return. If I have 100 files all created 1 hour apart, if I use this instruction something like this...
If settings.USRDriveFree < 1000 Then
'delete the oldest files
FileList("USR",fileToDelete(1))
FileManage(fileToDelete(1),8)
EndIf
will FileList() return the oldest file to delete or is it random?
Cheers
Ryan
I believe it is not random. Depending on how you name files, it might be true that the first file is the oldest.
The safe way to handle it is to use the FileTime instruction to check the timestamps of your files. Loop through your list using FileTime to fill an array with the timestamps. The timestamps will be an integer. Use MinSpa to check which one in the array has the lowest timestamp(oldest).