about summary refs log tree commit diff
path: root/library
diff options
context:
space:
mode:
authorJosh Triplett <josh@joshtriplett.org>2025-08-05 15:10:24 -0700
committerJosh Triplett <josh@joshtriplett.org>2025-08-05 15:10:24 -0700
commita99860b13a7f83a74b72beeddc9802e230f60212 (patch)
treebae959335810f6fd7793a9a6e20cf315cb22639e /library
parent1bb14a8bb79a7dda67d678209b1b731ee1a781b9 (diff)
downloadrust-a99860b13a7f83a74b72beeddc9802e230f60212.tar.gz
rust-a99860b13a7f83a74b72beeddc9802e230f60212.zip
`File::set_times`: Add documentation about setting directory timestamps
Inspired by https://github.com/rust-lang/rust/issues/123883 .
Diffstat (limited to 'library')
-rw-r--r--library/std/src/fs.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs
index 08976ae668e..eb9f99af220 100644
--- a/library/std/src/fs.rs
+++ b/library/std/src/fs.rs
@@ -1111,6 +1111,10 @@ impl File {
     /// `futimes` on macOS before 10.13) and the `SetFileTime` function on Windows. Note that this
     /// [may change in the future][changes].
     ///
+    /// On most platforms, including UNIX and Windows platforms, this function can also change the
+    /// timestamps of a directory. To do so, open the directory with `File::open`, without
+    /// attempting to obtain write permission.
+    ///
     /// [changes]: io#platform-specific-behavior
     ///
     /// # Errors