Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion library/std/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1111,6 +1111,11 @@ 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 get a `File` representing a directory in order to call
/// `set_times`, open the directory with `File::open` without attempting to obtain write
/// permission.
///
/// [changes]: io#platform-specific-behavior
///
/// # Errors
Expand All @@ -1128,7 +1133,7 @@ impl File {
/// use std::fs::{self, File, FileTimes};
///
/// let src = fs::metadata("src")?;
/// let dest = File::options().write(true).open("dest")?;
/// let dest = File::open("dest")?;
/// let times = FileTimes::new()
/// .set_accessed(src.accessed()?)
/// .set_modified(src.modified()?);
Expand Down
Loading