From 0ece30dc7c0e34b4c5911969b8fa99c33c6d023c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 30 Nov 2022 17:48:47 +0300 Subject: Telegram: update for TDLIB --- protocols/Telegram/tdlib/td/benchmark/rmdir.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'protocols/Telegram/tdlib/td/benchmark/rmdir.cpp') 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; } -- cgit v1.2.3