Bazel client: platform-specific {Read,Write}File
Move blaze::ReadFile and blaze::WriteFile to
file.h and file_platform.h (thus into the
blaze_util namespace), and update references.
This allows us to implement these methods in a
platform-specific way.
Also move UnlinkPath.
See https://github.com/bazelbuild/bazel/issues/2107
--
MOS_MIGRATED_REVID=140328273
diff --git a/src/main/cpp/blaze_util_linux.cc b/src/main/cpp/blaze_util_linux.cc
index 0057e3d..4d2ebfe 100644
--- a/src/main/cpp/blaze_util_linux.cc
+++ b/src/main/cpp/blaze_util_linux.cc
@@ -173,7 +173,7 @@
string statfile = "/proc/" + pid + "/stat";
string statline;
- if (!ReadFile(statfile, &statline)) {
+ if (!blaze_util::ReadFile(statfile, &statline)) {
return false;
}
@@ -199,7 +199,7 @@
}
string start_time_file = blaze_util::JoinPath(server_dir, "server.starttime");
- if (!WriteFile(start_time, start_time_file)) {
+ if (!blaze_util::WriteFile(start_time, start_time_file)) {
pdie(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR,
"Cannot write start time in server dir %s", server_dir.c_str());
}
@@ -218,7 +218,7 @@
}
string recorded_start_time;
- bool file_present = ReadFile(
+ bool file_present = blaze_util::ReadFile(
blaze_util::JoinPath(output_base, "server/server.starttime"),
&recorded_start_time);