alexcrichton/filetime

Accessing file timestamps in a platform-agnostic fashion in Rust

Rust

131

190 commits

updated May 12, 2026

See the code

README

filetime

Documentation

Note: this library is quite old and superseded by functionality in the standard library. Nowadays you shouldn't use this crate and you should use FileTimes and File::set_times instead.

A helper library for inspecting and setting the various timestamps of files in Rust. This library takes into account cross-platform differences in terms of where the timestamps are located, what they are called, and how to convert them into a platform-independent representation.

# Cargo.toml
[dependencies]
filetime = "0.2"

Advantages over using std::fs::Metadata

This library, when built with RUSTFLAGS=--cfg emulate_second_only_system set, will return all times rounded down to the second. This emulates the behavior of some file systems, mostly HFS, allowing debugging on other hardware.

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Filetime by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Significant stargazers

Weihang Lo

623 followers · starred Jan 2024

Eduardo Broto

45 followers · starred Oct 2019

Peter Blackson

152 followers · starred Dec 2021

Joel Natividad

234 followers · starred Aug 2024

alexcrichton/filetime

Accessing file timestamps in a platform-agnostic fashion in Rust

Rust

131

190 commits

updated May 12, 2026

See the code

README

filetime

Documentation

Note: this library is quite old and superseded by functionality in the standard library. Nowadays you shouldn't use this crate and you should use FileTimes and File::set_times instead.

A helper library for inspecting and setting the various timestamps of files in Rust. This library takes into account cross-platform differences in terms of where the timestamps are located, what they are called, and how to convert them into a platform-independent representation.

# Cargo.toml
[dependencies]
filetime = "0.2"

Advantages over using std::fs::Metadata

This library, when built with RUSTFLAGS=--cfg emulate_second_only_system set, will return all times rounded down to the second. This emulates the behavior of some file systems, mostly HFS, allowing debugging on other hardware.

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Filetime by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Significant stargazers

Weihang Lo

623 followers · starred Jan 2024

Eduardo Broto

45 followers · starred Oct 2019

Peter Blackson

152 followers · starred Dec 2021

Joel Natividad

234 followers · starred Aug 2024