* :--------------------------------------- * ------------------------: Copybook for GetFileTime. * : * : See the documentation for details. * :--------------------------------------- * * The GetFileTime API returns the time a file was created, * last accessed, and last written (modified). Time is returned * both in Windows FILETIME format (a 64-bit number representing * the number of 100-nanosecond intervals since January 1, 1601 * (UTC), and in Windows SYSTEMTIME format (year, month, day-of- * week (0 is Sunday), day, hour, minute, second, and * milliseconds). * Important: * Times are in coordinated universal time (UTC), not local time * except for Windows 9x platforms, which are always local time. * ---------------------------------------------------------------- * * To use: * * COPY WIN32API. * COPY GETFTIME. * . * . * ------------------------: Load the target filespec, which is * : limited to 1024 bytes. * * MOVE 'C:\MYDIR\TARGET.FIL' TO FT-FILESPEC. * * ------------------------: Call the API to get filetimes. * * SET API-GETFILETIME TO TRUE. * CALL 'GSWINAPI' USING WIN32API-PARMS * FT-FILESPEC * FT-CREATE-TIME * FT-LAST-ACCESS-TIME * FT-LAST-WRITE-TIME * WIN32API-E * WIN32API-F. * * ------------------------: If function failed, * : display a textual error message. * * IF WIN32API-FAILED * MOVE WIN32API-ERROR-TEXT TO my-error-message * do whatever to display my-error-message. * 01 FT-FILESPEC PIC X(1024). * 01 FT-CREATE-TIME. 05 FTCT-FILETIME PIC 9(18) COMP-5. 05 FTCT-SYSTEMTIME. 10 FTCT-YEAR PIC S9(4) COMP-5. 10 FTCT-MONTH PIC S9(4) COMP-5. 10 FTCT-DAY-OF-WEEK PIC S9(4) COMP-5. 10 FTCT-DAY PIC S9(4) COMP-5. 10 FTCT-HOUR PIC S9(4) COMP-5. 10 FTCT-MINUTE PIC S9(4) COMP-5. 10 FTCT-SECOND PIC S9(4) COMP-5. 10 FTCT-MILLISECOND PIC S9(4) COMP-5. * 01 FT-LAST-ACCESS-TIME. 05 FTLA-FILETIME PIC 9(18) COMP-5. 05 FTLA-SYSTEMTIME. 10 FTLA-YEAR PIC S9(4) COMP-5. 10 FTLA-MONTH PIC S9(4) COMP-5. 10 FTLA-DAY-OF-WEEK PIC S9(4) COMP-5. 10 FTLA-DAY PIC S9(4) COMP-5. 10 FTLA-HOUR PIC S9(4) COMP-5. 10 FTLA-MINUTE PIC S9(4) COMP-5. 10 FTLA-SECOND PIC S9(4) COMP-5. 10 FTLA-MILLISECOND PIC S9(4) COMP-5. * 01 FT-LAST-WRITE-TIME. 05 FTLW-FILETIME PIC 9(18) COMP-5. 05 FTLW-SYSTEMTIME. 10 FTLW-YEAR PIC S9(4) COMP-5. 10 FTLW-MONTH PIC S9(4) COMP-5. 10 FTLW-DAY-OF-WEEK PIC S9(4) COMP-5. 10 FTLW-DAY PIC S9(4) COMP-5. 10 FTLW-HOUR PIC S9(4) COMP-5. 10 FTLW-MINUTE PIC S9(4) COMP-5. 10 FTLW-SECOND PIC S9(4) COMP-5. 10 FTLW-MILLISECOND PIC S9(4) COMP-5.