makeDir() in run client.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Thu, 17 Oct 2013 12:55:14 +0000 (14:55 +0200)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Thu, 17 Oct 2013 12:55:14 +0000 (14:55 +0200)
run.cpp

diff --git a/run.cpp b/run.cpp
index cfda31a..ee2fd5c 100644 (file)
--- a/run.cpp
+++ b/run.cpp
@@ -40,6 +40,7 @@ int main(int argc, char *argv[]) {
                std::cout << "  c ... create" << std::endl;
                std::cout << "  z ... setSize" << std::endl;
                std::cout << "  m ... setMode" << std::endl;
+               std::cout << "  k ... makeDir" << std::endl;
        }
 
        if (argc >= 2) conf = argv[1];
@@ -214,6 +215,18 @@ int main(int argc, char *argv[]) {
 
                        break;
                }
+
+               case 'k': {
+                       mode_t mode;
+
+                       operation = "make directory";
+
+                       mode = 0755;
+                       if (argc >= 5) mode = strtoull(arg.c_str(), NULL, 8);
+                       catalog->makeDir(path, mode);
+
+                       break;
+               }
                }
        } catch (dmlite::DmException& e) {
                std::cout << "Could not " << operation << "." << std::endl