summaryrefslogtreecommitdiff
path: root/protocols/Telegram/tdlib/td/benchmark/rmdir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Telegram/tdlib/td/benchmark/rmdir.cpp')
-rw-r--r--protocols/Telegram/tdlib/td/benchmark/rmdir.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/protocols/Telegram/tdlib/td/benchmark/rmdir.cpp b/protocols/Telegram/tdlib/td/benchmark/rmdir.cpp
index d61baa0a02..ffc51828f4 100644
--- a/protocols/Telegram/tdlib/td/benchmark/rmdir.cpp
+++ b/protocols/Telegram/tdlib/td/benchmark/rmdir.cpp
@@ -1,9 +1,10 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
+#include "td/utils/common.h"
#include "td/utils/logging.h"
#include "td/utils/port/path.h"
#include "td/utils/Slice.h"
@@ -17,8 +18,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 {