| 887 | } |
| 888 | |
| 889 | bool PlatformFileSystem::filesize(PathId fileId, std::streamsize *result) { |
| 890 | if (!fileId) return false; |
| 891 | |
| 892 | const std::filesystem::path filepath = toPath(fileId); |
| 893 | if (filepath.empty()) return false; |
| 894 | |
| 895 | std::error_code ec; |
| 896 | std::streamsize length = std::filesystem::file_size(filepath, ec); |
| 897 | if (!ec) { |
| 898 | if (result != nullptr) { |
| 899 | *result = length; |
| 900 | } |
| 901 | return true; |
| 902 | } |
| 903 | return false; |
| 904 | } |
| 905 | |
| 906 | std::filesystem::file_time_type PlatformFileSystem::modtime( |
| 907 | PathId fileId, std::filesystem::file_time_type defaultOnFail) { |