Forget to use stringToPath(vFilePathName) may cause fs::last_write_time(fpath) to trigger an error when the file path contains Unicode characters on the Windows platform.
void FileSystemStd::GetFileDateAndSize(const std::string& vFilePathName, const IGFD::FileType& vFileType, std::string& voDate, size_t& voSize) override {
namespace fs = std::filesystem;
try {
// orignin
// fs::path fpath(vFilePathName);
// after FIX
fs::path fpath = stringToPath(vFilePathName);
size_t len{};
const auto lastWriteTime = fs::last_write_time(fpath); // origin code Will Error here
/// codes...
} catch (const fs::filesystem_error& ex) {
voSize = 0;
voDate.clear();
IGFD_COUT << "IGFD : " << ex.what() << std::endl;
}
}
Forget to use stringToPath(vFilePathName) may cause fs::last_write_time(fpath) to trigger an error when the file path contains Unicode characters on the Windows platform.