aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/cpp/util/file_platform.h
diff options
context:
space:
mode:
authorGravatar laszlocsomor <laszlocsomor@google.com>2017-03-30 12:38:05 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2017-03-31 17:07:37 +0200
commit111b3ac7ef616664890b733f7a0205adf40d3268 (patch)
tree2ae692178531f681c0a47ca0fc6705ec74959e5f /src/main/cpp/util/file_platform.h
parent6127358c1799d8d83cebbd499edac89f869df41b (diff)
Bazel client: simplify ReadDirectorySymlink
This is a bugfixed version of https://cr.bazel.build/9520 which broke some Google-internal tests. This change allows removing duplicate code: ReadDirectorySymlink was implemented on Windows as a junction resolver, which is also implemented in file_windows.cc. Now it uses the JunctionResolver. RELNOTES: none PiperOrigin-RevId: 151691895
Diffstat (limited to 'src/main/cpp/util/file_platform.h')
-rw-r--r--src/main/cpp/util/file_platform.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/cpp/util/file_platform.h b/src/main/cpp/util/file_platform.h
index 50b75de3bb..31a0d1c24c 100644
--- a/src/main/cpp/util/file_platform.h
+++ b/src/main/cpp/util/file_platform.h
@@ -130,6 +130,11 @@ enum RenameDirectoryResult {
// Returns one of the RenameDirectoryResult enum values.
int RenameDirectory(const std::string &old_name, const std::string &new_name);
+// Reads which directory a symlink points to. Puts the target of the symlink
+// in ``result`` and returns if the operation was successful. Will not work on
+// symlinks that don't point to directories on Windows.
+bool ReadDirectorySymlink(const std::string &symlink, std::string *result);
+
// Unlinks the file given by 'file_path'.
// Returns true on success. In case of failure sets errno.
bool UnlinkPath(const std::string &file_path);