file_time_compare

 

Description

compare two file time

Syntax

int file_time_compare( LPCSTR lpczFile1, LPCSTR lpczFile2, DWORD dwOption = CREATION_TIME )

Parameters

lpczFile1
[input] file1 to be compared
lpczFile2
[input] file2 to be compared
dwOption
[input] one of the constants in the enum FILE_TIME, can be CREATION_TIME, LAST_ACCESS_TIME or LAST_WRITE_TIME.

Return

1 if lpczFile1 file time is newer than lpczFile2

0 if lpczFile1 file time is not newer than lpczFile2

-1 if lpczFile1 or lpczFile2 is not file

Examples

EX1

void file_time_compare_ex1()
{
    LPCSTR lpczFile1= GetAppPath(true) + "origin.ini";        //sepecify a existing file
    LPCSTR lpczFile2= GetAppPath(true) + "nlsf.ini";        //sepecify a existing file
    
    if(file_time_compare(lpczFile1, lpczFile2) > 0)
    {
        out_str("File1 is newer than File2");
    }
}

Remark

See Also

header to Include

origin.h

Reference