return file's modified time
| 2730 | |
| 2731 | // return file's modified time |
| 2732 | long 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 |
| 2751 | long int SystemTools::CreationTime(std::string const& filename) |
nothing calls this directly
no test coverage detected