10 releases

0.3.1 Jul 10, 2020
0.3.0 May 21, 2020
0.2.2 Sep 27, 2018
0.2.0 Jan 8, 2017
0.0.1 Jul 28, 2015

#444 in Filesystem

Download history 4729/week @ 2024-01-05 3711/week @ 2024-01-12 2947/week @ 2024-01-19 3221/week @ 2024-01-26 4177/week @ 2024-02-02 5638/week @ 2024-02-09 5467/week @ 2024-02-16 6613/week @ 2024-02-23 4491/week @ 2024-03-01 3142/week @ 2024-03-08 3828/week @ 2024-03-15 6738/week @ 2024-03-22 6267/week @ 2024-03-29 4027/week @ 2024-04-05 5201/week @ 2024-04-12 4252/week @ 2024-04-19

20,730 downloads per month
Used in 5 crates (3 directly)

Apache-2.0 OR MIT

9KB
106 lines

utime

A missing utime function for Rust.

Standard library of Rust doesn't provide stable way to set atime/mtime of a file. This crate provides stable way to change a file's last modification and access time.

[dependencies]
utime = "0.2"
use std::fs::File;
use utime::*;

File::create("target/testdummy").unwrap();
set_file_times("target/testdummy", 1000000, 1000000000).unwrap();

let (accessed, modified) = get_file_times("target/testdummy").unwrap();
assert_eq!(accessed, 1000000);
assert_eq!(modified, 1000000000);


utime is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0). See COPYRIGHT for details.

Dependencies

~215KB