Skip to content

Commit a99860b

Browse files
committed
File::set_times: Add documentation about setting directory timestamps
Inspired by #123883 .
1 parent 1bb14a8 commit a99860b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

library/std/src/fs.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,10 @@ impl File {
11111111
/// `futimes` on macOS before 10.13) and the `SetFileTime` function on Windows. Note that this
11121112
/// [may change in the future][changes].
11131113
///
1114+
/// On most platforms, including UNIX and Windows platforms, this function can also change the
1115+
/// timestamps of a directory. To do so, open the directory with `File::open`, without
1116+
/// attempting to obtain write permission.
1117+
///
11141118
/// [changes]: io#platform-specific-behavior
11151119
///
11161120
/// # Errors

0 commit comments

Comments
 (0)