Don't use wxMkDir, it shows stupid error messages

This commit is contained in:
Twan van Laarhoven
2020-05-16 20:04:10 +02:00
parent 424fd96185
commit 6b6306fc86
3 changed files with 11 additions and 1 deletions
+8
View File
@@ -113,6 +113,14 @@ time_t file_modified_time(const String& path) {
// ----------------------------------------------------------------------------- : Directories
bool create_directory(const String& path) {
#if defined(__WX_MSW__)
return _wmkdir(path.fn_str()) == 0;
#else
return mkdir(path.fn_str()) == 0;
#endif
}
bool create_parent_dirs(const String& file) {
for (size_t pos = file.find_first_of(_("\\/"), 1) ;
pos != String::npos ;
+2
View File
@@ -45,6 +45,8 @@ time_t file_modified_time(const String& name);
// ----------------------------------------------------------------------------- : Removing and renaming
bool create_directory(const String& path);
/// Ensure that the parent directories of the given filename exist
bool create_parent_dirs(const String& file);
+1 -1
View File
@@ -401,7 +401,7 @@ void Package::openZipfile() {
void Package::saveToDirectory(const String& saveAs, bool remove_unused, bool is_copy) {
// create directory?
wxMkdir(saveAs);
create_directory(saveAs);
// write to a directory
VCSP vcs = getVCS();
FOR_EACH(f, files) {