mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 05:40:01 -06:00
Better error messages, Dolphin will create save directories if not present.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@37 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -51,3 +51,25 @@ void File::Explore(const std::string &path)
|
||||
ShellExecuteEx(&shex);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Returns true if successful, or path already exists.
|
||||
bool File::CreateDir(const std::string &path)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if (::CreateDirectory(path.c_str(), NULL))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
DWORD error = GetLastError();
|
||||
if (error == ERROR_ALREADY_EXISTS)
|
||||
{
|
||||
PanicAlert("%s already exists", path.c_str());
|
||||
return true;
|
||||
}
|
||||
PanicAlert("Error creating directory: %i", error);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
}
|
Reference in New Issue
Block a user