MCPcopy Create free account
hub / github.com/Kitware/CMake / ModifiedTime

Method ModifiedTime

Source/kwsys/SystemTools.cxx:2732–2748  ·  view source on GitHub ↗

return file's modified time

Source from the content-addressed store, hash-verified

2730
2731// return file's modified time
2732long int SystemTools::ModifiedTime(std::string const& filename)
2733{
2734 long int mt = 0;
2735#ifdef _WIN32
2736 WIN32_FILE_ATTRIBUTE_DATA fs;
2737 if (GetFileAttributesExW(Encoding::ToWindowsExtendedPath(filename).c_str(),
2738 GetFileExInfoStandard, &fs) != 0) {
2739 mt = windows_filetime_to_posix_time(fs.ftLastWriteTime);
2740 }
2741#else
2742 struct stat fs;
2743 if (stat(filename.c_str(), &fs) == 0) {
2744 mt = static_cast<long int>(fs.st_mtime);
2745 }
2746#endif
2747 return mt;
2748}
2749
2750// return file's creation time
2751long int SystemTools::CreationTime(std::string const& filename)

Callers

nothing calls this directly

Calls 3

c_strMethod · 0.80
statClass · 0.70

Tested by

no test coverage detected