General discussion

  • Creator
    Topic
  • #2080616

    Return

    Locked

    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

All Comments

  • Author
    Replies
    • #3895369

      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.

      • #3893943

        Return

        by jinuq ·

        In reply to Return

        Thanks for the help.

Viewing 0 reply threads