From e129fb08d294e650b500a0834f577a4131fb686c Mon Sep 17 00:00:00 2001 From: Hadi Ravanbakhsh Date: Wed, 11 Dec 2024 14:57:20 -0800 Subject: [PATCH] No public description PiperOrigin-RevId: 705251978 --- common/remote_file_oss.cc | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/common/remote_file_oss.cc b/common/remote_file_oss.cc index 2ea73afe..d9300def 100644 --- a/common/remote_file_oss.cc +++ b/common/remote_file_oss.cc @@ -247,15 +247,9 @@ absl::Status RemotePathTouchExistingFile(std::string_view path) { return absl::InvalidArgumentError( absl::StrCat("path: ", std::string(path), " does not exist.")); } - std::error_code error; - std::filesystem::last_write_time( - path, std::filesystem::file_time_type::clock::now(), error); - if (error) { - return absl::UnknownError(absl::StrCat( - "filesystem::last_write_time() failed, path: ", std::string(path), - ", error: ", error.message())); - } - return absl::OkStatus(); + if (0 == utimes(path.data(), nullptr)) return absl::OkStatus(); + return absl::InternalError( + absl::StrCat("Failed to set mtime for ", path, " (errno ", errno, ").")); } absl::Status RemotePathDelete(std::string_view path, bool recursively) {