Replace use of pbd/filesystem.h with Glib equivalent in Mootcher class
[ardour.git] / gtk2_ardour / sfdb_freesound_mootcher.cc
index 70d04abb6670e11a6f4eefe1bb995c93a556820b..b0a4d90339bf61e8c362fd9b89ab3e2692875034 100644 (file)
@@ -41,7 +41,7 @@
 #include "sfdb_freesound_mootcher.h"\r
 \r
 #include "pbd/xml++.h"\r
-#include "pbd/filesystem.h"\r
+#include "pbd/error.h"\r
 \r
 #include <sys/stat.h>\r
 #include <sys/types.h>\r
@@ -91,10 +91,12 @@ void Mootcher::changeWorkingDir(const char *saveLocation)
 \r
 void Mootcher::ensureWorkingDir ()\r
 {\r
-       PBD::sys::path p = basePath;\r
-       p /= "snd";\r
-       if (!PBD::sys::is_directory (p)) {\r
-               PBD::sys::create_directories (p);\r
+       std::string p = Glib::build_filename (basePath, "snd");\r
+\r
+       if (!Glib::file_test (p, Glib::FILE_TEST_IS_DIR)) {\r
+               if (g_mkdir_with_parents (p.c_str(), 0775) != 0) {\r
+                       PBD::error << "Unable to create Mootcher working dir" << endmsg;\r
+               }\r
        }\r
 }\r
        \r