aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/cpp/util/file_windows.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/cpp/util/file_windows.cc')
-rw-r--r--src/main/cpp/util/file_windows.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/cpp/util/file_windows.cc b/src/main/cpp/util/file_windows.cc
index c2e0fd79ee..af6ed4f325 100644
--- a/src/main/cpp/util/file_windows.cc
+++ b/src/main/cpp/util/file_windows.cc
@@ -863,6 +863,21 @@ bool JunctionResolver::Resolve(const WCHAR* path, unique_ptr<WCHAR[]>* result) {
return Resolve(path, result, kMaximumJunctionDepth);
}
+bool ReadDirectorySymlink(const string& name, string* result) {
+ wstring wname;
+ if (!AsWindowsPathWithUncPrefix(name, &wname)) {
+ PrintError("ReadDirectorySymlink: AsWindowsPathWithUncPrefix(%s)",
+ name.c_str());
+ return false;
+ }
+ unique_ptr<WCHAR[]> result_ptr;
+ if (!JunctionResolver().Resolve(wname.c_str(), &result_ptr)) {
+ return false;
+ }
+ *result = WstringToCstring(RemoveUncPrefixMaybe(result_ptr.get())).get();
+ return true;
+}
+
bool PathExists(const string& path) {
if (path.empty()) {
return false;