net: create directory for config file if it doesn't exist.

This commit is contained in:
Shawn Hoffman 2012-02-23 12:48:54 -08:00
parent f73c82c232
commit 9866cae4ff
1 changed files with 9 additions and 0 deletions

View File

@ -168,6 +168,15 @@ public:
void WriteConfig()
{
if (!File::Exists(path))
{
if (!File::CreateFullPath(
std::string(File::GetUserPath(D_WIISYSCONF_IDX) + "net/02/")))
{
ERROR_LOG(WII_IPC_NET, "Failed to create directory for network config file");
}
}
File::IOFile(path, "wb").WriteBytes((void*)&config, sizeof(config));
}