]> Creatis software - crea.git/blobdiff - src/creaSystem.cxx
create directory in windows
[crea.git] / src / creaSystem.cxx
index 49ca11f93bf3c8192e81987a8a2a7b139cf724b7..1346a08a085d16efc80fe686fde8a6d75f5ab975 100644 (file)
@@ -230,8 +230,14 @@ std::string System::GetExecutablePath(){
        
        void System::createDirectory(const char* directorypath){
                #ifdef WIN32
-               //TODO
-                       CreateDirectory(directorypath);
+                       if (CreateDirectory(directorypath, NULL) == ERROR_ALREADY_EXISTS) 
+                       { 
+                               std::cout<<"directory already exists "<<directorypath<<std::endl;
+                       }else if(CreateDirectory(directorypath, NULL) == ERROR_PATH_NOT_FOUND){
+                               std::string error = "Directory could not be created ";
+                               error.append(directorypath);
+                               throw error.c_str();
+                       }
                #endif
                #ifdef LINUX
                        //! include sys/types.h