MCPcopy Create free account
hub / github.com/Tencent/phxqueue / CopyDir

Function CopyDir

phxqueue/comm/utils/file_util.cpp:233–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231}
232
233int CopyDir(const string &src_dir_path, const string &dst_dir_path) {
234 // struct required, rationale: function stat() exists also
235 struct stat src_stat;
236 if (-1 == stat(src_dir_path.c_str(), &src_stat)) {
237 int ret{errno};
238 // TODO:
239 //QLErr("stat \"%s\" err %d", src_dir_path.c_str(), ret);
240
241 return ret;
242 }
243
244 if (-1 == mkdir(dst_dir_path.c_str(), src_stat.st_mode)) {
245 int ret{errno};
246 // TODO:
247 //QLErr("mkdir \"%s\" err %d", dst_dir_path.c_str(), ret);
248
249 return ret;
250 }
251 // TODO:
252 //QLInfo("mkdir \"%s\" ok", dst_dir_path.c_str());
253
254 return 0;
255}
256
257int RecursiveListDir(const string &dir_path, vector<string> *file_paths, vector<string> *sub_dir_paths,
258 const bool recursive) {

Callers 1

RecursiveCopyDirFunction · 0.85

Calls 1

statClass · 0.70

Tested by

no test coverage detected