diff --git a/source/fileop.cpp b/source/fileop.cpp index 39c0323..3222dde 100644 --- a/source/fileop.cpp +++ b/source/fileop.cpp @@ -699,6 +699,20 @@ ParseDirectory(bool waitParse, bool filter) return browser.numEntries; } +bool CreateDirectory(char * path) +{ + DIR *dir = opendir(path); + if (!dir) { + if(mkdir(path, 0777) != 0) { + return false; + } + } + else { + closedir(dir); + } + return true; +} + /**************************************************************************** * AllocSaveBuffer () * Clear and allocate the savebuffer diff --git a/source/fileop.h b/source/fileop.h index ddd681f..2ef6174 100644 --- a/source/fileop.h +++ b/source/fileop.h @@ -32,6 +32,7 @@ void CreateAppPath(char * origpath); bool GetFileSize(int i); void FindAndSelectLastLoadedFile(); int ParseDirectory(bool waitParse = false, bool filter = true); +bool CreateDirectory(char * path); void AllocSaveBuffer(); void FreeSaveBuffer(); size_t LoadFile(char * rbuffer, char *filepath, size_t length, bool silent); diff --git a/source/preferences.cpp b/source/preferences.cpp index 2d843b1..e9a62d1 100644 --- a/source/preferences.cpp +++ b/source/preferences.cpp @@ -580,8 +580,6 @@ bool LoadPrefs() sprintf(filepath[1], "cardb:/%s", APPFOLDER); #endif - printf("in load prefs\n"); - for(int i=0; i