]> git.lizzy.rs Git - rust.git/commitdiff
Add File set_permissions
authorJeremy Soller <jackpot51@gmail.com>
Wed, 23 Nov 2016 15:24:49 +0000 (08:24 -0700)
committerJeremy Soller <jackpot51@gmail.com>
Wed, 23 Nov 2016 15:24:49 +0000 (08:24 -0700)
src/libstd/sys/redox/fs.rs

index 3a7b8266a63fb1ade4a786ccc5b6c20dc137681d..2b0ab361492ccbb025c4fd542424828406562f7e 100644 (file)
@@ -316,6 +316,10 @@ pub fn dup(&self, buf: &[u8]) -> io::Result<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) {