| 1 |
# filetime |
| 2 |
|
| 3 |
[Documentation](https://docs.rs/filetime) |
| 4 |
|
| 5 |
> **Note**: this library is quite old and superseded by functionality in the |
| 6 |
> standard library. Nowadays you shouldn't use this crate and you should use |
| 7 |
> [`FileTimes`] and [`File::set_times`] instead. |
| 8 |
|
| 9 |
[`FileTimes`]: https://doc.rust-lang.org/stable/std/fs/struct.FileTimes.html |
| 10 |
[`File::set_times`]: https://doc.rust-lang.org/stable/std/fs/struct.File.html#method.set_times |
| 11 |
|
| 12 |
A helper library for inspecting and setting the various timestamps of files in |
| 13 |
Rust. This library takes into account cross-platform differences in terms of |
| 14 |
where the timestamps are located, what they are called, and how to convert them |
| 15 |
into a platform-independent representation. |
| 16 |
|
| 17 |
```toml |
| 18 |
# Cargo.toml |
| 19 |
[dependencies] |
| 20 |
filetime = "0.2" |
| 21 |
``` |
| 22 |
|
| 23 |
# Advantages over using `std::fs::Metadata` |
| 24 |
|
| 25 |
This library, when built with `RUSTFLAGS=--cfg emulate_second_only_system` set, |
| 26 |
will return all times rounded down to the second. This emulates the behavior of |
| 27 |
some file systems, mostly [HFS](https://en.wikipedia.org/wiki/HFS_Plus), |
| 28 |
allowing debugging on other hardware. |
| 29 |
|
| 30 |
# License |
| 31 |
|
| 32 |
This project is licensed under either of |
| 33 |
|
| 34 |
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or |
| 35 |
http://www.apache.org/licenses/LICENSE-2.0) |
| 36 |
* MIT license ([LICENSE-MIT](LICENSE-MIT) or |
| 37 |
http://opensource.org/licenses/MIT) |
| 38 |
|
| 39 |
at your option. |
| 40 |
|
| 41 |
### Contribution |
| 42 |
|
| 43 |
Unless you explicitly state otherwise, any contribution intentionally submitted |
| 44 |
for inclusion in Filetime by you, as defined in the Apache-2.0 license, shall be |
| 45 |
dual licensed as above, without any additional terms or conditions. |