Add File set_permissions
This commit is contained in:
parent
b3c91dfb6a
commit
4a0bc71bb7
1 changed files with 4 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue