From 111b3ac7ef616664890b733f7a0205adf40d3268 Mon Sep 17 00:00:00 2001 From: laszlocsomor Date: Thu, 30 Mar 2017 12:38:05 +0000 Subject: 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 --- src/main/cpp/util/file_platform.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/main/cpp/util/file_platform.h') 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); -- cgit v1.2.3