Rename RemotePathRename to RemoteFileRename to support only file renaming.

We only need file renaming. Directory renaming can be tricky for remote paths.

PiperOrigin-RevId: 723159063
diff --git a/centipede/centipede_interface.cc b/centipede/centipede_interface.cc
index 7c0784d..0e16d1e 100644
--- a/centipede/centipede_interface.cc
+++ b/centipede/centipede_interface.cc
@@ -344,7 +344,7 @@
           !crash_metadata.insert(new_crash_metadata).second;
       if (is_duplicate) continue;
       CHECK_OK(
-          RemotePathRename(crashing_input_file,
+          RemoteFileRename(crashing_input_file,
                            (crashing_dir / crashing_input_file_name).c_str()));
     }
   }
@@ -642,7 +642,7 @@
     if (!stats_root_path.empty()) {
       const auto stats_dir = stats_root_path / fuzz_tests_to_run[i];
       CHECK_OK(RemoteMkdir(stats_dir.c_str()));
-      CHECK_OK(RemotePathRename(
+      CHECK_OK(RemoteFileRename(
           workdir.FuzzingStatsPath(),
           (stats_dir / absl::StrCat("fuzzing_stats_", execution_stamp))
               .c_str()));
@@ -667,7 +667,7 @@
       const std::string file_name =
           std::filesystem::path(corpus_file).filename();
       CHECK_OK(
-          RemotePathRename(corpus_file, (coverage_dir / file_name).c_str()));
+          RemoteFileRename(corpus_file, (coverage_dir / file_name).c_str()));
     }
 
     // Deduplicate and update the crashing inputs.
diff --git a/common/BUILD b/common/BUILD
index 617f581..e2d55d3 100644
--- a/common/BUILD
+++ b/common/BUILD
@@ -246,6 +246,9 @@
     name = "remote_file_test_lib",
     testonly = True,
     srcs = ["remote_file_test.cc"],
+    defines = select({
+        "//conditions:default": [],
+    }),
     deps = [
         ":logging",
         ":remote_file",
@@ -254,7 +257,9 @@
         "@com_google_absl//absl/status",
         "@com_google_absl//absl/time",
         "@com_google_googletest//:gtest",
-    ],
+    ] + select({
+        "//conditions:default": [],
+    }),
     alwayslink = True,
 )
 
diff --git a/common/remote_file.h b/common/remote_file.h
index 08c65d1..f1a6718 100644
--- a/common/remote_file.h
+++ b/common/remote_file.h
@@ -136,8 +136,8 @@
 absl::StatusOr<std::vector<std::string>> RemoteListFiles(std::string_view path,
                                                          bool recursively);
 
-// Renames `from` to `to`.
-absl::Status RemotePathRename(std::string_view from, std::string_view to);
+// Renames a file from `from` to `to`.
+absl::Status RemoteFileRename(std::string_view from, std::string_view to);
 
 // Updates the last-modified time of `path` to the current time.
 absl::Status RemotePathTouchExistingFile(std::string_view path);
diff --git a/common/remote_file_oss.cc b/common/remote_file_oss.cc
index 405c195..a583fe1 100644
--- a/common/remote_file_oss.cc
+++ b/common/remote_file_oss.cc
@@ -181,7 +181,7 @@
   LOG(FATAL) << "Filesystem API not supported in iOS/MacOS";
 }
 
-absl::Status RemotePathRename(std::string_view from, std::string_view to) {
+absl::Status RemoteFileRename(std::string_view from, std::string_view to) {
   LOG(FATAL) << "Filesystem API not supported in iOS/MacOS";
 }
 
@@ -235,7 +235,7 @@
              : list_files(std::filesystem::directory_iterator(path));
 }
 
-absl::Status RemotePathRename(std::string_view from, std::string_view to) {
+absl::Status RemoteFileRename(std::string_view from, std::string_view to) {
   std::error_code error;
   std::filesystem::rename(from, to, error);
   if (error) {