Add File set_permissions
This commit is contained in:
parent
b3c91dfb6a
commit
4a0bc71bb7
@ -316,6 +316,10 @@ impl File {
|
||||
Ok(File(FileDesc::new(fd)))
|
||||
}
|
||||
|
||||
pub fn set_permissions(&self, perm: FilePermissions) -> io::Result<()> {
|
||||
set_perm(&self.path()?, perm)
|
||||
}
|
||||
|
||||
pub fn path(&self) -> io::Result<PathBuf> {
|
||||
let mut buf: [u8; 4096] = [0; 4096];
|
||||
match libc::fpath(*self.fd().as_inner() as usize, &mut buf) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user