return file's creation time
| 2749 | |
| 2750 | // return file's creation time |
| 2751 | long 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 | |
| 2769 | std::string SystemTools::GetLastSystemError() |
| 2770 | { |
nothing calls this directly
no test coverage detected