Crate file_id

source ·
Expand description

A utility to read file IDs that are unique on a given device.

Modern file systems assign a unique ID to each file. On Linux and MacOS it is called an inode number, on Windows it is called a file index. Together with the device id, a file can be identified uniquely on a device at a given time.

Keep in mind though, that IDs may be re-used at some point.

Example

let file = tempfile::NamedTempFile::new().unwrap();

let file_id = file_id::get_file_id(file.path()).unwrap();

println!("{file_id:?}");

Structs

  • Unique identifier of a file

Functions