Crate win_file_id

Crate win_file_id 

Source
Expand description

Utility for reading file ids (Windows) that uniquely identify a file on a single computer.

Modern file systems assign a unique ID to each file. 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 = win_file_id::get_file_id(file.path()).unwrap();
println!("{file_id:?}");

§Example (Windows Only)

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

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

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

Enums§

FileId
Unique identifier of a file

Functions§

get_file_id
Get the FileId for the file or directory at path
get_high_res_file_id
Get the FileId with the high resolution variant for the file or directory at path
get_low_res_file_id
Get the FileId with the low resolution variant for the file or directory at path