Logo Search packages:      
Sourcecode: inkscape version File versions

bool buildtool::MakeBase::isNewerThan ( const String &  fileA,
const String &  fileB 
) [protected, inherited]

Tests is the modification date of fileA is newer than fileB

Tests is the modification of fileA is newer than fileB

Definition at line 4338 of file buildtool.cpp.

References buildtool::MakeBase::getNativePath().

{
    //trace("isNewerThan:'%s' , '%s'", fileA.c_str(), fileB.c_str());
    String nativeA = getNativePath(fileA);
    struct stat infoA;
    //IF source does not exist, NOT newer
    if (stat(nativeA.c_str(), &infoA)<0)
        {
        return false;
        }

    String nativeB = getNativePath(fileB);
    struct stat infoB;
    //IF dest does not exist, YES, newer
    if (stat(nativeB.c_str(), &infoB)<0)
        {
        return true;
        }

    //check the actual times
    if (infoA.st_mtime > infoB.st_mtime)
        {
        return true;
        }

    return false;
}


Generated by  Doxygen 1.6.0   Back to index