std::string arg;
if (argc < 3) {
- std::cout << "Usage: " << argv[0] << " [ DMLITE_CONFIGFILE [ s | d | h | (r|w|c) [PATH] | z [PATH [SIZE]] ] ]" << std::endl;
+ std::cout << "Usage: " << argv[0] << " [ DMLITE_CONFIGFILE [ s | d | h | (r|w|c) [PATH] | z [PATH [SIZE]] | m PATH mode ] ]" << std::endl;
std::cout << " s ... stat" << std::endl;
std::cout << " d ... opendir/readdir" << std::endl;
std::cout << " r ... read" << std::endl;
std::cout << " w ... whereToWrite" << std::endl;
std::cout << " c ... create" << std::endl;
std::cout << " z ... setSize" << std::endl;
+ std::cout << " m ... setMode" << std::endl;
}
if (argc >= 2) conf = argv[1];
operation = "create";
- if (argc >= 5) mode = atoll(arg.c_str());
+ if (argc >= 5) mode = strtoull(arg.c_str(), NULL, 8);
catalog->create(path, mode);
break;
operation = "set size";
size = 20000;
- if (argc >= 5) size = strtoull(arg.c_str(), NULL, 8);
+ if (argc >= 5) size = strtoull(arg.c_str(), NULL, 10);
catalog->setSize(path, size);
break;
}
+
+ case 'm': {
+ mode_t mode;
+
+ operation = "set mode";
+
+ mode = 0644;
+ if (argc >= 5) mode = strtoull(arg.c_str(), NULL, 8);
+ catalog->setMode(path, mode);
+
+ break;
+ }
}
} catch (dmlite::DmException& e) {
std::cout << "Could not " << operation << "." << std::endl