File tree 2 files changed +8
-7
lines changed
2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 2
2
//! with setting the file times.
3
3
4
4
use crate :: fs:: { open, OpenOptions , SystemTimeSpec } ;
5
- use fs_set_times:: SetTimes ;
6
5
use rustix:: io:: Errno ;
7
6
use std:: path:: Path ;
8
7
use std:: { fs, io} ;
@@ -17,7 +16,8 @@ pub(crate) fn set_times_impl(
17
16
// access, so first try write.
18
17
match open ( start, path, OpenOptions :: new ( ) . write ( true ) ) {
19
18
Ok ( file) => {
20
- return file. set_times (
19
+ return fs_set_times:: SetTimes :: set_times (
20
+ & file,
21
21
atime. map ( SystemTimeSpec :: into_std) ,
22
22
mtime. map ( SystemTimeSpec :: into_std) ,
23
23
)
@@ -31,7 +31,8 @@ pub(crate) fn set_times_impl(
31
31
// Next try read.
32
32
match open ( start, path, OpenOptions :: new ( ) . read ( true ) ) {
33
33
Ok ( file) => {
34
- return file. set_times (
34
+ return fs_set_times:: SetTimes :: set_times (
35
+ & file,
35
36
atime. map ( SystemTimeSpec :: into_std) ,
36
37
mtime. map ( SystemTimeSpec :: into_std) ,
37
38
)
Original file line number Diff line number Diff line change 1
1
use crate :: fs:: { open, OpenOptions , SystemTimeSpec } ;
2
- use fs_set_times:: SetTimes ;
3
2
use std:: os:: windows:: fs:: OpenOptionsExt ;
4
3
use std:: path:: Path ;
5
4
use std:: { fs, io} ;
@@ -37,12 +36,13 @@ fn set_times_inner(
37
36
let custom_flags = custom_flags | FILE_FLAG_BACKUP_SEMANTICS ;
38
37
39
38
// On Windows, `set_times` requires write permissions.
40
- open (
39
+ let file = open (
41
40
start,
42
41
path,
43
42
OpenOptions :: new ( ) . write ( true ) . custom_flags ( custom_flags) ,
44
- ) ?
45
- . set_times (
43
+ ) ?;
44
+ fs_set_times:: SetTimes :: set_times (
45
+ & file,
46
46
atime. map ( SystemTimeSpec :: into_std) ,
47
47
mtime. map ( SystemTimeSpec :: into_std) ,
48
48
)
You can’t perform that action at this time.
0 commit comments