Example #1
0
bool FileGetFileTime(OovStringRef const path, time_t &time)
{
    struct OovStat32 srcFileStat;
    bool success = (OovStat32(path.getStr(), &srcFileStat) == 0);
    if(success)
        time = srcFileStat.st_mtime;
    return success;
}
Example #2
0
OovStatusReturn FileGetFileTime(OovStringRef const path, time_t &time)
    {
    struct OovStat32 srcFileStat;
    OovStatus status(OovStat32(path.getStr(), &srcFileStat) == 0, SC_File);
    if(status.ok())
        time = srcFileStat.st_mtime;
    return status;
    }
Example #3
0
bool FileIsDirOnDisk(OovStringRef const path, bool &success)
{
    struct OovStat32 statval;
    int statRet = OovStat32(path, &statval);
    // Indicate there is an error only if the error is not ENOENT.
    success = ((statRet == 0) || (errno == ENOENT));
    // Only indicate the directory exists if there was no error, and it is a directory.
    return((statRet == 0) && S_ISDIR(statval.st_mode));
}
Example #4
0
bool FileIsFileOnDisk(OovStringRef const path, bool &success)
{
    OovString tempPath = path;
    FilePathRemovePathSep(tempPath, tempPath.size()-1);
    struct OovStat32 statval;
    int statRet = OovStat32(tempPath.getStr(), &statval);
    // Indicate there is an error only if the error is not ENOENT.
    success = ((statRet == 0) || (errno == ENOENT));
    // Only indicate the file exists if there was no error, and it is a file.
    return((statRet == 0) && !S_ISDIR(statval.st_mode));
}