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; }
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; }
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)); }
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)); }