mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 21:41:26 +12:00
Fix issue from #567 that stopped videos from working. Clean up some code.
This commit is contained in:
parent
6bd044f9be
commit
82536b298c
5 changed files with 62 additions and 68 deletions
|
@ -153,13 +153,7 @@ bool rFile::Open(const std::string &filename, rFile::OpenMode mode, int access)
|
|||
|
||||
bool rFile::Exists(const std::string &file)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
std::wstring wstr = ConvertUTF8ToWString(file);
|
||||
return GetFileAttributes(wstr.c_str()) != 0xFFFFFFFF;
|
||||
#else
|
||||
struct stat buffer;
|
||||
return (stat (file.c_str(), &buffer) == 0);
|
||||
#endif
|
||||
rExists(file);
|
||||
}
|
||||
|
||||
bool rFile::IsOpened() const
|
||||
|
@ -215,6 +209,27 @@ bool rRmdir(const std::string &dir)
|
|||
#endif
|
||||
}
|
||||
|
||||
bool rRename(const std::string &from, const std::string &to)
|
||||
{
|
||||
// TODO: Deal with case-sensitivity
|
||||
#ifdef _WIN32
|
||||
return (MoveFile(ConvertUTF8ToWString(from).c_str(), ConvertUTF8ToWString(to).c_str()) == TRUE);
|
||||
#else
|
||||
return (0 == rename(from.c_str(), to.c_str()));
|
||||
#endif
|
||||
}
|
||||
|
||||
bool rExists(const std::string &file)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
std::wstring wstr = ConvertUTF8ToWString(file);
|
||||
return GetFileAttributes(wstr.c_str()) != 0xFFFFFFFF;
|
||||
#else
|
||||
struct stat buffer;
|
||||
return (stat (file.c_str(), &buffer) == 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool rDirExists(const std::string &path)
|
||||
{
|
||||
return wxDirExists(fmt::FromUTF8(path));
|
||||
|
@ -287,8 +302,6 @@ bool rDir::GetNext(std::string *filename) const
|
|||
*filename = str.ToStdString();
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
rFileName::rFileName()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue