From 757c880616e7a4bd6da801b2fdf0ad6610b14bec Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Tue, 15 Apr 2025 13:59:03 -0500 Subject: [PATCH] debug logs --- .../src/drives/fuse/remotefuse/remote_server.cpp | 12 +++++++++++- .../repertory_test/src/winfsp_drive_rename_test.cpp | 3 ++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/repertory/librepertory/src/drives/fuse/remotefuse/remote_server.cpp b/repertory/librepertory/src/drives/fuse/remotefuse/remote_server.cpp index 08ff2eda..c11ea500 100644 --- a/repertory/librepertory/src/drives/fuse/remotefuse/remote_server.cpp +++ b/repertory/librepertory/src/drives/fuse/remotefuse/remote_server.cpp @@ -28,6 +28,7 @@ #include "drives/directory_iterator.hpp" #include "drives/remote/remote_open_file_table.hpp" #include "events/event_system.hpp" +#include "events/types/debug_log.hpp" #include "events/types/remote_server_event.hpp" #include "platform/platform.hpp" #include "types/remote.hpp" @@ -1448,10 +1449,19 @@ auto remote_server::winfsp_rename(PVOID /*file_desc*/, PWSTR file_name, : 0); } else { auto dir{utils::file::directory(file_path)}; + event_system::instance().raise( + function_name, + fmt::format("path|{}|exists|{}", file_path, dir.exists())); if (dir.exists()) { - if (dir.count(false) == 0U) { + auto count{dir.count(false)}; + event_system::instance().raise( + function_name, fmt::format("path|{}|count|{}", file_path, count)); + if (count == 0U) { res = drive_.rename_directory(construct_api_path(file_path), construct_api_path(new_file_path)); + event_system::instance().raise( + function_name, + fmt::format("path|{}|res|{}", api_error_to_string(res))); ret = ((res < 0) ? errno == EISDIR ? static_cast(STATUS_ACCESS_DENIED) diff --git a/repertory/repertory_test/src/winfsp_drive_rename_test.cpp b/repertory/repertory_test/src/winfsp_drive_rename_test.cpp index e4b9a94e..e03e106b 100644 --- a/repertory/repertory_test/src/winfsp_drive_rename_test.cpp +++ b/repertory/repertory_test/src/winfsp_drive_rename_test.cpp @@ -74,7 +74,7 @@ TYPED_TEST(winfsp_test, rename_fails_if_dest_exists_and_replace_is_false) { utils::path::combine(dir_path, {"test_file2_5"}), }; auto file_path3{ - utils::path::combine(dir_path, {"test_file_5"}), + utils::path::combine(dir_path, {"test_file3_5"}), }; ASSERT_TRUE(::CreateDirectoryA(dir_path.c_str(), nullptr)); @@ -157,6 +157,7 @@ TYPED_TEST(winfsp_test, rename_dir_succeeds_if_dest_does_not_exist) { ASSERT_TRUE(::CreateDirectoryA(dir_path.c_str(), nullptr)); EXPECT_TRUE(::MoveFileExA(dir_path.c_str(), dir_path2.c_str(), 0)); + fmt::println("error|{}", ::GetLastError()); EXPECT_TRUE(::RemoveDirectoryA(dir_path2.c_str())); }