Sailo
23rd September 2002 14:15 UTC
Getting File Last Modified Date
I basically want to get a files last modified date and get the current date and compare the 2.
If the last modified date is more than a month ago i want to delete the file.
Has anybody got any ideas as to how to do this?
Joost Verburg
23rd September 2002 14:26 UTC
You can use GetFileTime to get the last modified date of a file. To get the current date have a look here: http://forums.winamp.com/showthread....threadid=70281
Sailo
23rd September 2002 15:06 UTC
How do i use GetFileTime? Whats the high and low dwords?
kichik
23rd September 2002 15:17 UTC
http://forums.winamp.com/showthread....ight=file+time
Search the forum please...
Sailo
23rd September 2002 15:32 UTC
I have searched and am still no closer.
I have the 2 dword values which don't mean a deal to me and i can get the current date using rainwaters dll.
How do i compare these?
Sorry if i'm missing something obvious
kichik
23rd September 2002 15:48 UTC
Rainwater's DLL won't give you the same format as GetFileTime so create another file, get it's time, which is the current time because you created it now, and compare.
Use the script in the link I gave you above to compare the two.
Sailo
23rd September 2002 15:53 UTC
Right ok got it now. Sorry i got mislead.
Sailo
23rd September 2002 20:59 UTC
I want to check if a file is older than a month or not.
If i create a new file it will have todays date on it so how do i minus a month of it?
brainsucker
23rd September 2002 22:29 UTC
last modified
These dwords, when combined represent "64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC)." [MSDN ;)]
So, 100 nanos intervals => 1 second contains 10000000 such intervals.
Just multiply by 60*60*24*30 to receive average month length :) The only problem should be 64-bit calculations... :)