computer_help
asked on
Obtaining relative times
I am writting a program(Visual C++ 6.0) to detelete files older than 30 days. In order to do this I have been using the GetFileTime function. I then was going to try to add 30 days to this value and use CompareFileTime to determine if the file needs to be deleted.
In order to add 30 days to a FileTime I was under the impression that you had to:
a) Convert your times from SYSTETIME to FILETIME using SystemTimeToFileTime function:
b) Copy the resulting FILETIME structure to a LARGE_INTEGER strucutre.
c) Use normal arithmetics on LARGE_INTEGER value.
However I can not get this to work . If someone could show me an example of adding 30 days to a file time, or suggest a time library that would take care of all this for me that would be great.
In order to add 30 days to a FileTime I was under the impression that you had to:
a) Convert your times from SYSTETIME to FILETIME using SystemTimeToFileTime function:
b) Copy the resulting FILETIME structure to a LARGE_INTEGER strucutre.
c) Use normal arithmetics on LARGE_INTEGER value.
However I can not get this to work . If someone could show me an example of adding 30 days to a file time, or suggest a time library that would take care of all this for me that would be great.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER