diff options
author | George Hazan <ghazan@miranda.im> | 2022-11-30 17:48:47 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-11-30 17:48:47 +0300 |
commit | 0ece30dc7c0e34b4c5911969b8fa99c33c6d023c (patch) | |
tree | 671325d3fec09b999411e4e3ab84ef8259261818 /protocols/Telegram/tdlib/td/benchmark/rmdir.cpp | |
parent | 46c53ffc6809c67e4607e99951a2846c382b63b2 (diff) |
Telegram: update for TDLIB
Diffstat (limited to 'protocols/Telegram/tdlib/td/benchmark/rmdir.cpp')
-rw-r--r-- | protocols/Telegram/tdlib/td/benchmark/rmdir.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/protocols/Telegram/tdlib/td/benchmark/rmdir.cpp b/protocols/Telegram/tdlib/td/benchmark/rmdir.cpp index f1676baa63..d61baa0a02 100644 --- a/protocols/Telegram/tdlib/td/benchmark/rmdir.cpp +++ b/protocols/Telegram/tdlib/td/benchmark/rmdir.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2018 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022 // // 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) @@ -14,15 +14,16 @@ int main(int argc, char *argv[]) { } td::CSlice dir(argv[1]); int cnt = 0; - auto status = td::walk_path(dir, [&](td::CSlice path, bool is_dir) { - cnt++; - LOG(INFO) << path << " " << is_dir; - // if (is_dir) { + 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); + } + //if (is_dir) { // td::rmdir(path); //} else { // td::unlink(path); //} }); LOG(INFO) << status << ": " << cnt; - return 0; } |