diff options
| author | levlam <levlam@telegram.org> | 2023-01-04 17:25:30 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2023-01-04 17:25:30 +0300 |
| commit | 3573990d524123b861730827366f898183c998f1 (patch) | |
| tree | bd710a4920fa0d05408ad4dc650f2df5d127d2c4 /benchmark/rmdir.cpp | |
| parent | 8df67f0c3a77fd9bb07ef05c68042cd5870986a0 (diff) | |
Support symbolic links in walk_path.
Diffstat (limited to 'benchmark/rmdir.cpp')
| -rw-r--r-- | benchmark/rmdir.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/benchmark/rmdir.cpp b/benchmark/rmdir.cpp index 163f2986b..1a1a7133b 100644 --- a/benchmark/rmdir.cpp +++ b/benchmark/rmdir.cpp @@ -17,8 +17,23 @@ int main(int argc, char *argv[]) { auto status = td::walk_path(dir, [&](td::CSlice path, auto type) { if (type != td::WalkPath::Type::EnterDir) { cnt++; - LOG(INFO) << path << " " << (type == td::WalkPath::Type::ExitDir); } + auto type_name = [&] { + switch (type) { + case td::WalkPath::Type::EnterDir: + return td::CSlice("Open"); + case td::WalkPath::Type::ExitDir: + return td::CSlice("Exit"); + case td::WalkPath::Type::RegularFile: + return td::CSlice("File"); + case td::WalkPath::Type::Symlink: + return td::CSlice("Link"); + default: + UNREACHABLE(); + return td::CSlice(); + } + }(); + LOG(INFO) << type_name << ' ' << path; //if (is_dir) { // td::rmdir(path); //} else { |
