General discussion

Locked

Return

By jinuq ·
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

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Return

by Wayne M. In reply to Return

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.

Collapse -

Return

by jinuq In reply to Return

Thanks for the help.

Back to Web Development Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums