Remove FileSystem::Get/SetFilePermissions
Differential Revision: https://reviews.llvm.org/D31089 llvm-svn: 298205
This commit is contained in:
@@ -30,34 +30,6 @@ FileSpec::PathSyntax FileSystem::GetNativePathSyntax() {
|
||||
return FileSpec::ePathSyntaxWindows;
|
||||
}
|
||||
|
||||
Error FileSystem::GetFilePermissions(const FileSpec &file_spec,
|
||||
uint32_t &file_permissions) {
|
||||
Error error;
|
||||
// Beware that Windows's permission model is different from Unix's, and it's
|
||||
// not clear if this API is supposed to check ACLs. To match the caller's
|
||||
// expectations as closely as possible, we'll use Microsoft's _stat, which
|
||||
// attempts to emulate POSIX stat. This should be good enough for basic
|
||||
// checks like FileSpec::Readable.
|
||||
struct _stat file_stats;
|
||||
if (::_stat(file_spec.GetCString(), &file_stats) == 0) {
|
||||
// The owner permission bits in "st_mode" currently match the definitions
|
||||
// for the owner file mode bits.
|
||||
file_permissions = file_stats.st_mode & (_S_IREAD | _S_IWRITE | _S_IEXEC);
|
||||
} else {
|
||||
error.SetErrorToErrno();
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
Error FileSystem::SetFilePermissions(const FileSpec &file_spec,
|
||||
uint32_t file_permissions) {
|
||||
Error error;
|
||||
error.SetErrorStringWithFormat("%s is not supported on this host",
|
||||
LLVM_PRETTY_FUNCTION);
|
||||
return error;
|
||||
}
|
||||
|
||||
lldb::user_id_t FileSystem::GetFileSize(const FileSpec &file_spec) {
|
||||
return file_spec.GetByteSize();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user