#inode #index #file

bin+lib brk-file-id

Utility for reading inode numbers (Linux, MacOS) and file IDs (Windows)

1 unstable release

0.2.3 Sep 28, 2025

#2581 in Filesystem

Download history 50/week @ 2025-10-13 61/week @ 2025-10-20 32/week @ 2025-10-27 15/week @ 2025-11-03 21/week @ 2025-11-10 12/week @ 2025-11-17 12/week @ 2025-11-24 20/week @ 2025-12-01 15/week @ 2025-12-08 18/week @ 2025-12-15 14/week @ 2025-12-22 15/week @ 2025-12-29 16/week @ 2026-01-05 8/week @ 2026-01-12 33/week @ 2026-01-19 12/week @ 2026-01-26

73 downloads per month
Used in 6 crates (via brk-notify-debouncer-full)

MIT/Apache

10KB
143 lines

Utility for reading inode numbers (Linux, macOS) and file ids (Windows) that uniquely identify a file on a single computer.

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 id or file index. Together with the device id (Linux, macOS) or the volume serial number (Windows), a file or directory can be uniquely identified on a single computer 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:?}");

Example (Windows Only)

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

let file_id = file_id::get_low_res_file_id(file.path()).unwrap();
println!("{file_id:?}");

let file_id = file_id::get_high_res_file_id(file.path()).unwrap();
println!("{file_id:?}");

File Id

» Docs

A utility to read file IDs.

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 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_id = file_id::get_file_id(path).unwrap();

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

Features

  • serde for serde support, off by default

Dependencies

~0–12MB
~83K SLoC