File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 22//! with setting the file times.
33
44use crate :: fs:: { open, OpenOptions , SystemTimeSpec } ;
5- use fs_set_times:: SetTimes ;
65use rustix:: io:: Errno ;
76use std:: path:: Path ;
87use std:: { fs, io} ;
@@ -17,7 +16,8 @@ pub(crate) fn set_times_impl(
1716 // access, so first try write.
1817 match open ( start, path, OpenOptions :: new ( ) . write ( true ) ) {
1918 Ok ( file) => {
20- return file. set_times (
19+ return fs_set_times:: SetTimes :: set_times (
20+ & file,
2121 atime. map ( SystemTimeSpec :: into_std) ,
2222 mtime. map ( SystemTimeSpec :: into_std) ,
2323 )
@@ -31,7 +31,8 @@ pub(crate) fn set_times_impl(
3131 // Next try read.
3232 match open ( start, path, OpenOptions :: new ( ) . read ( true ) ) {
3333 Ok ( file) => {
34- return file. set_times (
34+ return fs_set_times:: SetTimes :: set_times (
35+ & file,
3536 atime. map ( SystemTimeSpec :: into_std) ,
3637 mtime. map ( SystemTimeSpec :: into_std) ,
3738 )
Original file line number Diff line number Diff line change 11use crate :: fs:: { open, OpenOptions , SystemTimeSpec } ;
2- use fs_set_times:: SetTimes ;
32use std:: os:: windows:: fs:: OpenOptionsExt ;
43use std:: path:: Path ;
54use std:: { fs, io} ;
@@ -37,12 +36,13 @@ fn set_times_inner(
3736 let custom_flags = custom_flags | FILE_FLAG_BACKUP_SEMANTICS ;
3837
3938 // On Windows, `set_times` requires write permissions.
40- open (
39+ let file = open (
4140 start,
4241 path,
4342 OpenOptions :: new ( ) . write ( true ) . custom_flags ( custom_flags) ,
44- ) ?
45- . set_times (
43+ ) ?;
44+ fs_set_times:: SetTimes :: set_times (
45+ & file,
4646 atime. map ( SystemTimeSpec :: into_std) ,
4747 mtime. map ( SystemTimeSpec :: into_std) ,
4848 )
You can’t perform that action at this time.
0 commit comments