Lines Matching refs:from_dir
77 std::string from_dir; member
90 string_repr << "\t.from_dir = " << from_dir << ",\n"; in to_string()
102 from_dir = to_dir = "./"; in reset()
129 << " (default '" << command.from_dir << "').\n"; in usage()
131 << "/" << Command::HARDLINK << " (default '" << command.from_dir << "').\n"; in usage()
194 bool move_files(const std::string& from_dir, const std::string& to_dir, int n_file, in move_files() argument
196 int from_dir_fd = open(from_dir.c_str(), OPEN_DIR_FLAGS); in move_files()
199 std::cerr << "Failed to open source directory '" << from_dir << "', error '" in move_files()
226 bool hardlink_files(const std::string& from_dir, const std::string& to_dir, int n_file, in hardlink_files() argument
228 int from_dir_fd = open(from_dir.c_str(), OPEN_DIR_FLAGS); in hardlink_files()
231 std::cerr << "Failed to open source directory '" << from_dir << "', error '" in hardlink_files()
258 bool symlink_files(std::string from_dir, const std::string& to_dir, int n_file, in symlink_files() argument
260 if (from_dir.back() != '/') from_dir.push_back('/'); in symlink_files()
271 std::string from_filepath = from_dir + from_basename + std::to_string(i); in symlink_files()
281 bool exhaustive_readdir(const std::string& from_dir) { in exhaustive_readdir() argument
282 DIR* dir = opendir(from_dir.c_str()); in exhaustive_readdir()
285 std::cerr << "Failed to open working directory '" << from_dir << "', error '" in exhaustive_readdir()
305 if (create_files(command.from_dir, command.n_file, command.from_basename)) in create_workload()
308 delete_files(command.from_dir, command.n_file, command.from_basename); in create_workload()
312 if (!create_files(command.from_dir, command.n_file, command.from_basename)) return; in delete_workload()
316 if (delete_files(command.from_dir, command.n_file, command.from_basename)) in delete_workload()
321 if (!create_files(command.from_dir, command.n_file, command.from_basename)) return; in move_workload()
325 if (move_files(command.from_dir, command.to_dir, command.n_file, command.from_basename, in move_workload()
333 if (!create_files(command.from_dir, command.n_file, command.from_basename)) return; in hardlink_workload()
337 if (hardlink_files(command.from_dir, command.to_dir, command.n_file, command.from_basename, in hardlink_workload()
341 delete_files(command.from_dir, command.n_file, command.from_basename); in hardlink_workload()
346 if (!create_files(command.from_dir, command.n_file, command.from_basename)) return; in symlink_workload()
350 if (symlink_files(command.from_dir, command.to_dir, command.n_file, command.from_basename, in symlink_workload()
355 delete_files(command.from_dir, command.n_file, command.from_basename); in symlink_workload()
359 if (!create_files(command.from_dir, command.n_file, command.from_basename)) return; in readdir_workload()
363 if (exhaustive_readdir(command.from_dir)) collector->collect_metric(command.workload); in readdir_workload()
365 delete_files(command.from_dir, command.n_file, command.from_basename); in readdir_workload()
401 command.from_dir = optarg; in main()