We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
File::set_modified
1 parent 24b66da commit e2b5729Copy full SHA for e2b5729
library/std/src/fs.rs
@@ -638,6 +638,15 @@ impl File {
638
pub fn set_times(&self, times: FileTimes) -> io::Result<()> {
639
self.inner.set_times(times.0)
640
}
641
+
642
+ /// Changes the modification time of the underlying file.
643
+ ///
644
+ /// This is an alias for `set_times(FileTimes::new().set_modified(time))`.
645
+ #[unstable(feature = "file_set_times", issue = "98245")]
646
+ #[inline]
647
+ pub fn set_modified(&self, time: SystemTime) -> io::Result<()> {
648
+ self.set_times(FileTimes::new().set_modified(time))
649
+ }
650
651
652
// In addition to the `impl`s here, `File` also has `impl`s for
0 commit comments