Remove FileSystem::Get/SetFilePermissions

Differential Revision: https://reviews.llvm.org/D31089

llvm-svn: 298205
This commit is contained in:
Zachary Turner
2017-03-19 05:49:43 +00:00
parent 3a86a04404
commit 6934e0aaa7
5 changed files with 13 additions and 62 deletions

View File

@@ -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();
}