Expose Windows VolumeSerialNumber and FileIndex/FileId in std::os::windows::fs::MetadataExt #56180
Labels
A-io
Area: `std::io`, `std::fs`, `std::net` and `std::path`
O-windows
Operating system: Windows
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
Currently, using
std::os::unix::fs::MetadataExt
andstd::os::linux::fs::MetadataExt
it is possible to get the inode number of a file. This can be useful in determining whether two files are the same. There's a similar concept in Windows, consisting of a few parts:VolumeSerialNumber
: The serial number of the volume that contains the file.FileIndex
: A 64 bit unique (within a volume) identifier that is associated with a file.FileId
: A 128 bit unique (within a volume) identifier that is associated with a file (this is the "evolution" of the above, according to the docs currently only used by ReFS).Sources: _BY_HANDLE_FILE_INFORMATION _FILE_ID_INFO
Combining the
VolumeSerialNumber
andFileIndex
/FileId
of a file is thus a unique identifier of a file on a single machine (at a given time; unique IDs may be reused).I would like these to get added to
std::os::windows::fs::MetadataExt
. The changes needed would be fairly tiny (literally just exposing already available data in case ofVolumeSerialNumber
andFileIndex
here but an additional function call forFileId
), and it wouldn't introduce any breaking changes as far as I can see, it would only add 2/3 methods. Would this require an RFC?I see that the RFCs README lists "Additions to std." as an as example, but on the other hand I wouldn't say this is a "substantial" change.
The text was updated successfully, but these errors were encountered: