Fix for issue 734 (creating profile on a fresh install is completely broken.)

This commit is contained in:
wagic.the.homebrew
2011-09-17 08:42:13 +00:00
parent a6c458d0cb
commit c96d2fea55
6 changed files with 38 additions and 35 deletions

View File

@@ -19,6 +19,11 @@ The content that users should not be touching.
#ifdef WIN32
#pragma warning(disable : 4786)
#include <direct.h>
#define MAKEDIR(name) _mkdir(name)
#else
#include <sys/stat.h>
#define MAKEDIR(name) mkdir(name, 0777)
#endif
#include "../include/JGE.h"
@@ -149,6 +154,8 @@ JFileSystem::JFileSystem(const string & _userPath, const string & _systemPath)
}
mUserFSPath = userPath;
MAKEDIR(userPath.c_str());
mSystemFSPath = systemPath;
mUserFS = new filesystem(userPath.c_str());
@@ -184,6 +191,13 @@ bool JFileSystem::FileExists(const string& strFilename)
return result;
}
bool JFileSystem::MakeDir(const string & dir)
{
string fullDir = mUserFSPath + dir;
MAKEDIR(fullDir.c_str());
return true;
}
JFileSystem::~JFileSystem()
{
clearZipCache();