File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -216,7 +216,7 @@ impl MetadataExt for fs::Metadata {
216
216
}
217
217
}
218
218
219
- /*
219
+ /* TODO
220
220
/// Add special unix types (block/char device, fifo and socket)
221
221
#[stable(feature = "file_type_ext", since = "1.5.0")]
222
222
pub trait FileTypeExt {
Original file line number Diff line number Diff line change @@ -386,9 +386,12 @@ pub fn rename(_old: &Path, _new: &Path) -> io::Result<()> {
386
386
unimplemented ! ( ) ;
387
387
}
388
388
389
- pub fn set_perm ( _p : & Path , _perm : FilePermissions ) -> io:: Result < ( ) > {
390
- :: sys_common:: util:: dumb_print ( format_args ! ( "Set perm\n " ) ) ;
391
- unimplemented ! ( ) ;
389
+ pub fn set_perm ( p : & Path , perm : FilePermissions ) -> io:: Result < ( ) > {
390
+ let mut options = OpenOptions :: new ( ) ;
391
+ options. read ( true ) ;
392
+ let file = File :: open ( p, & options) ?;
393
+ cvt ( libc:: fcntl ( file. 0 . raw ( ) , libc:: F_SETMODE , perm. mode as usize ) ) ?;
394
+ Ok ( ( ) )
392
395
}
393
396
394
397
pub fn rmdir ( p : & Path ) -> io:: Result < ( ) > {
You can’t perform that action at this time.
0 commit comments