diff --git a/src/fileutils.hpp b/src/fileutils.hpp index 5a01e9af0..77a48bbde 100644 --- a/src/fileutils.hpp +++ b/src/fileutils.hpp @@ -47,7 +47,7 @@ inline std::string get_home_dir(void) { return std::string(homedir); } inline void make_dir(std::string path, int perms=775) { - if( std::system(("mkdir -p "+path+" -m "+std::to_string(perms)).c_str()) ) { + if( std::system(("mkdir -p -m "+std::to_string(perms)+" "+path).c_str()) ) { throw std::runtime_error("Failed to create path: "+path); } }