Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How old is a file? Finding what file is older from a list.

Status
Not open for further replies.

gabek

MIS
Sep 29, 2000
1
US
I have a tast among me to search through multiple subdirectories and find the oldest file.

But the only way I could think of doing it is by doing a shell'ed out dir and taking the date string, and trying to compare it... but then it get's month strings and everything... any way i could get some type of function to say how many days old a file is? One number would seem much easier to compare.

But any ideas on how to decide on file life would be appreciated! Thanks!

Gabe [sig][/sig]
 
Sorry, Gabe, I know of no function in QB that would do it in one command.

It's too bad this site crashed several months ago (or at least it seems like months--no pun intended) because someone posted some code on what was called (I think) "A Julian Calendar" which gave a specific number for every day for the next 3000 +/- years (in which case it would revert to 0 and start all over again.

I once had that code but my hard drive crashed shortly after this site's did. I don't even know if I have a backup of the original BAS. I'll look around and if I do find it, I'll post the code again--but no promises.

--MiggyD [sig]<p> <br><a href=mailto: > </a><br><a href= > </a><br>You can pick your friends and you can pick your teeth and you can pick your toes, just don't pick you nose.[/sig]
 
I agree with MiggyD. The fastest way I know to do this kind of thing is to use INT 21 function SetDTA, and FindFirst, then FindNext repeatedly, which will give you a list of files and their file creation times in a integer format you can directly compare (instead of comparing month/day/year/hour/min. I have code to do this at home, but not online.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top