mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-13 13:15:59 +00:00
-Remove trailing separator when opening dirs if exist (windows doesn't like it)
-Support for opening dirs in windows
This commit is contained in:
parent
786ad6f71e
commit
0289b99d69
3 changed files with 71 additions and 6 deletions
|
@ -211,7 +211,15 @@ public:
|
|||
IOFile out(path, FileAccessMode::Write);
|
||||
return out.Write(data);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
std::filesystem::path RemoveTrailingSeparator(const std::filesystem::path& input) {
|
||||
std::wstring str = input.native();
|
||||
while (!str.empty() && (str.back() == L'\\' || str.back() == L'/')) {
|
||||
str.pop_back();
|
||||
}
|
||||
return std::filesystem::path(str);
|
||||
}
|
||||
#endif
|
||||
private:
|
||||
std::filesystem::path file_path;
|
||||
FileAccessMode file_access_mode{};
|
||||
|
@ -222,5 +230,7 @@ private:
|
|||
};
|
||||
|
||||
u64 GetDirectorySize(const std::filesystem::path& path);
|
||||
|
||||
#ifdef _WIN32
|
||||
FILE* OpenDirAsFilePtr(const wchar_t* path, const wchar_t* mode, bool isDirectory);
|
||||
#endif
|
||||
} // namespace Common::FS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue