Return
I am developing and application that needs to check the creation date of a text file. Then see if it is older than 2 weeks. If so delete it. I am using the GetFileTime API Call. I am programming in Assembly but any help would be good.
jInuQ
Web Development
I am developing and application that needs to check the creation date of a text file. Then see if it is older than 2 weeks. If so delete it. I am using the GetFileTime API Call. I am programming in Assembly but any help would be good.
jInuQ
by wayne m.
You can get the current system time in a SYSTEMTIME structure using GetSystemTime(). You can then adjust system time back two weeks. You can use a look up table to simplify the month rollback, but you will need functions to handle March -> February for leap years and a function to adjust the year in January -> December rollbacks. Then you can convert this SYSTEMTIME structure to a FILETIME structure using SystemTimeToFileTime(). Finally, compare this value to the FILETIME returned by GetFileTime() using CompareFileTime().
I would probably suggest writing this function in C rather than assembly, but it probably would not be terribly difficult to do in straight assembly language.
by jinuq
This discussion is closed to new replies.
Sort by Trending