tg_cli: touch.

GitOrigin-RevId: e2e469b9b09bf5d4343318c715adbe51f37a283c
This commit is contained in:
levlam 2018-04-27 20:41:10 +03:00
parent ffe1b67fff
commit 7d9003980f

View File

@ -3033,6 +3033,18 @@ class CliClient final : public Actor {
make_tl_object<td_api::proxySocks5>(server, to_integer<int32>(port), user, password)));
} else if (op == "gproxy") {
send_request(make_tl_object<td_api::getProxy>());
} else if (op == "touch") {
auto r_fd = FileFd::open(args, FileFd::Read | FileFd::Write);
if (r_fd.is_error()) {
LOG(ERROR) << r_fd.error();
return;
}
auto fd = r_fd.move_as_ok();
auto size = fd.get_size();
fd.write("a").ignore();
fd.seek(size).ignore();
fd.truncate_to_current_position(size).ignore();
} else if (op == "SetVerbosity") {
td::Log::set_verbosity_level(to_integer<int>(args));
} else if (op == "q" || op == "Quit") {