Extremely Active Member
Group: Members
Posts: 273
Member No.: 3
Joined: 12-May 04
|
Compare the last write time of two files.
CODE | CompareFileTimes proc pszFile1:dword, pszFile2:dword � �local hFile,hFile2:dword � �local dtFile1:FILETIME � �local dtFile2:FILETIME
� �invoke CreateFile, pszFile1, GENERIC_READ+GENERIC_WRITE, FILE_SHARE_READ+FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL � �.if eax != INVALID_HANDLE_VALUE � � � �mov �hFile,eax � � � �invoke GetFileTime,hFile,NULL,NULL,addr dtFile1 � � � �invoke CloseHandle,hFile � � � �invoke CreateFile, pszFile2, GENERIC_READ+GENERIC_WRITE, FILE_SHARE_READ+FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL � � � �.if eax != INVALID_HANDLE_VALUE � � � � � �mov �hFile2,eax � � � � � �invoke GetFileTime,hFile2,NULL,NULL,addr dtFile2 � � � � � �invoke CloseHandle,hFile2 � � � � � �invoke CompareFileTime,addr dtFile1,addr dtFile2 � � � � � �ret � � � �.else � � � � � �return 2 � � � �.endif � �.else � � � �return 2 � �.endif � �ret CompareFileTimes endp
|
|