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

Method CreationTime

Source/kwsys/SystemTools.cxx:2751–2767  ·  view source on GitHub ↗

return file's creation time

Source from the content-addressed store, hash-verified

2749
2750// return file's creation time
2751long int SystemTools::CreationTime(std::string const& filename)
2752{
2753 long int ct = 0;
2754#ifdef _WIN32
2755 WIN32_FILE_ATTRIBUTE_DATA fs;
2756 if (GetFileAttributesExW(Encoding::ToWindowsExtendedPath(filename).c_str(),
2757 GetFileExInfoStandard, &fs) != 0) {
2758 ct = windows_filetime_to_posix_time(fs.ftCreationTime);
2759 }
2760#else
2761 struct stat fs;
2762 if (stat(filename.c_str(), &fs) == 0) {
2763 ct = fs.st_ctime >= 0 ? static_cast<long int>(fs.st_ctime) : 0;
2764 }
2765#endif
2766 return ct;
2767}
2768
2769std::string SystemTools::GetLastSystemError()
2770{

Callers

nothing calls this directly

Calls 3

c_strMethod · 0.80
statClass · 0.70

Tested by

no test coverage detected