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

#32 in Filesystem

Download history 1662/week @ 2020-08-06 1154/week @ 2020-08-13 2257/week @ 2020-08-20 1706/week @ 2020-08-27 658/week @ 2020-09-03 491/week @ 2020-09-10 526/week @ 2020-09-17 667/week @ 2020-09-24 692/week @ 2020-10-01 967/week @ 2020-10-08 754/week @ 2020-10-15 583/week @ 2020-10-22 586/week @ 2020-10-29 540/week @ 2020-11-05 532/week @ 2020-11-12 457/week @ 2020-11-19

5,973 downloads per month
Used in 2 crates

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

~33KB