diff --git a/stepmania/src/Profile.cpp b/stepmania/src/Profile.cpp index 4125258f46..b7464a3a82 100644 --- a/stepmania/src/Profile.cpp +++ b/stepmania/src/Profile.cpp @@ -687,17 +687,9 @@ bool Profile::SaveAllToDir( CString sDir, bool bSignData ) const SaveStatsWebPageToDir( sDir ); - // - // create edits dir - // - CString sEditsTempFile = sDir + EDITS_SUBDIR + "temp"; - RageFile f; - f.Open( sDir + EDITS_SUBDIR + "temp", RageFile::WRITE ); - f.Close(); - - FILEMAN->FlushDirCache( sDir + EDITS_SUBDIR ); - - FILEMAN->Remove( sEditsTempFile ); + // Empty directories if none exist. + FILEMAN->CreateDir( sDir + EDITS_SUBDIR ); + FILEMAN->CreateDir( sDir + SCREENSHOTS_SUBDIR ); return true; } diff --git a/stepmania/src/RageFileManager.cpp b/stepmania/src/RageFileManager.cpp index 414e0d8442..aaf01fc9a5 100644 --- a/stepmania/src/RageFileManager.cpp +++ b/stepmania/src/RageFileManager.cpp @@ -288,6 +288,16 @@ bool RageFileManager::Remove( CString sPath ) return Deleted; } +void RageFileManager::CreateDir( CString sDir ) +{ + CString sTempFile = sDir + "temp"; + RageFile f; + f.Open( sTempFile, RageFile::WRITE ); + f.Close(); + + FILEMAN->Remove( sTempFile ); + +} void RageFileManager::Mount( CString Type, CString Root, CString MountPoint ) { LockMut( *g_Mutex ); diff --git a/stepmania/src/RageFileManager.h b/stepmania/src/RageFileManager.h index 7033fda4de..130d71cf06 100644 --- a/stepmania/src/RageFileManager.h +++ b/stepmania/src/RageFileManager.h @@ -20,6 +20,7 @@ public: void GetDirListing( CString sPath, CStringArray &AddTo, bool bOnlyDirs, bool bReturnPathToo ); bool Remove( CString sPath ); + void CreateDir( CString sDir ); enum FileType { TYPE_FILE, TYPE_DIR, TYPE_NONE }; FileType GetFileType( CString sPath );