diff options
Diffstat (limited to 'llvm/lib/Support/Path.cpp')
-rw-r--r-- | llvm/lib/Support/Path.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp index fc3cf525c93..5ac60e8dc3e 100644 --- a/llvm/lib/Support/Path.cpp +++ b/llvm/lib/Support/Path.cpp @@ -1189,12 +1189,20 @@ std::error_code identify_magic(const Twine &Path, file_magic &Result) { } std::error_code directory_entry::status(file_status &result) const { - return fs::status(Path, result, FollowSymlinks); -} - -} // end namespace fs -} // end namespace sys -} // end namespace llvm + return fs::status(Path, result, FollowSymlinks);
+}
+
+ErrorOr<perms> getPermissions(const Twine &Path) {
+ file_status Status;
+ if (std::error_code EC = status(Path, Status))
+ return EC;
+
+ return Status.permissions();
+}
+
+} // end namespace fs
+} // end namespace sys
+} // end namespace llvm
// Include the truly platform-specific parts. #if defined(LLVM_ON_UNIX) |