mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-18 21:24:32 -04:00
Add support for getting file system permissions and implement sys::fs::permissions to set them.
Patch by James Henderson. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297617 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
+14
-6
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user