-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking issue for fs::Metadata
extensions on Windows based on handle information
#63010
Comments
More context for future readers: the This isn't the first time I've come across certain result types that perhaps can be expressed in a more semantically rich fashion than a bare The Windows 10 API team ran into a similar issue, where the basic "dir entry" entry type/"trait" Rather than returning a vague Getting dangerously close to the topic of asynchronizing |
I was wondering if anyone could offer some advice here, as to what needs to happen to get this functionality stabilised? |
Change the return types of `volume_serial_number()` and `number_of_links()` from `u64` to `u32`. This makes it easier to migrate code from manually using the underlying Windows APIs with `dwVolumeSerialNumber` and `nNumberOfLinks`, which are `u32`, to using `winapi_util::file::Information` instead. This also aligns with Rust nightly's [`windows_by_handle`] feature, where the [corresponding types are `u32`]. [`windows_by_handle`]: rust-lang/rust#63010 [corresponding types are `u32`]: https://doc.rust-lang.org/stable/std/os/windows/fs/trait.MetadataExt.html#tymethod.volume_serial_number
I am a bit concerned about the fact that |
Any progress here? Is there any chance to get this into stable branch anytime soon? |
Up, I would also really need this feature to be stabilized if possible |
It's been three years and not much movement so probably not soon unless someone takes an interest in pushing it forward. I think this is still pending figuring out some issues:
Perhaps another option is to have a Windows only |
Add the option on Unix systems to filter files by their inode number. The Windows equivalent FileIndex is not yet stabilized, see rust-lang/rust#63010. This is especially useful to debug audit records, e.g.: Jan 30 17:48:55 laptop audit: PATH item=0 name="pulse" inode=7340042 dev=fe:03 mode=040700 ouid=1001 ogid=1001 rdev=00:00 obj=system_u:object_r:unlabeled_t:s0 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0 Closes: sharkdp#880
Add the option on Unix systems to filter files by their inode number. The Windows equivalent FileIndex is not yet stabilized, see rust-lang/rust#63010. This is especially useful to debug audit records, e.g.: Jan 30 17:48:55 laptop audit: PATH item=0 name="pulse" inode=7340042 dev=fe:03 mode=040700 ouid=1001 ogid=1001 rdev=00:00 obj=system_u:object_r:unlabeled_t:s0 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0 Closes: sharkdp#880
Add the option on Unix systems to filter files by their inode number. The Windows equivalent FileIndex is not yet stabilized, see rust-lang/rust#63010. This is especially useful to debug audit records, e.g.: Jan 30 17:48:55 laptop audit: PATH item=0 name="pulse" inode=7340042 dev=fe:03 mode=040700 ouid=1001 ogid=1001 rdev=00:00 obj=system_u:object_r:unlabeled_t:s0 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0 Closes: sharkdp#880
Add the option on Unix systems to filter files by their inode number. The Windows equivalent FileIndex is not yet stabilized, see rust-lang/rust#63010. This is especially useful to debug audit records, e.g.: Jan 30 17:48:55 laptop audit: PATH item=0 name="pulse" inode=7340042 dev=fe:03 mode=040700 ouid=1001 ogid=1001 rdev=00:00 obj=system_u:object_r:unlabeled_t:s0 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0 Closes: sharkdp#880
Add the option on Unix systems to filter files by their inode number. The Windows equivalent FileIndex is not yet stabilized, see rust-lang/rust#63010. This is especially useful to debug audit records, e.g.: Jan 30 17:48:55 laptop audit: PATH item=0 name="pulse" inode=7340042 dev=fe:03 mode=040700 ouid=1001 ogid=1001 rdev=00:00 obj=system_u:object_r:unlabeled_t:s0 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0 Closes: sharkdp#880
Add the option on Unix systems to filter files by their inode number. The Windows equivalent FileIndex is not yet stabilized, see rust-lang/rust#63010. This is especially useful to debug audit records, e.g.: Jan 30 17:48:55 laptop audit: PATH item=0 name="pulse" inode=7340042 dev=fe:03 mode=040700 ouid=1001 ogid=1001 rdev=00:00 obj=system_u:object_r:unlabeled_t:s0 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0 Closes: sharkdp#880
Add the option on Unix systems to filter files by their inode number. The Windows equivalent FileIndex is not yet stabilized, see rust-lang/rust#63010. This is especially useful to debug audit records, e.g.: Jan 30 17:48:55 laptop audit: PATH item=0 name="pulse" inode=7340042 dev=fe:03 mode=040700 ouid=1001 ogid=1001 rdev=00:00 obj=system_u:object_r:unlabeled_t:s0 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0 Closes: sharkdp#880
Add the option on Unix systems to filter files by their inode number. The Windows equivalent FileIndex is not yet stabilized, see rust-lang/rust#63010. This is especially useful to debug audit records, e.g.: Jan 30 17:48:55 laptop audit: PATH item=0 name="pulse" inode=7340042 dev=fe:03 mode=040700 ouid=1001 ogid=1001 rdev=00:00 obj=system_u:object_r:unlabeled_t:s0 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0 Closes: sharkdp#880
Add the option on Unix systems to filter files by their inode number. The Windows equivalent FileIndex is not yet stabilized, see rust-lang/rust#63010. This is especially useful to debug audit records, e.g.: Jan 30 17:48:55 laptop audit: PATH item=0 name="pulse" inode=7340042 dev=fe:03 mode=040700 ouid=1001 ogid=1001 rdev=00:00 obj=system_u:object_r:unlabeled_t:s0 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0 Closes: sharkdp#880
Add the option on Unix systems to filter files by their inode number. The Windows equivalent FileIndex is not yet stabilized, see rust-lang/rust#63010. This is especially useful to debug audit records, e.g.: Jan 30 17:48:55 laptop audit: PATH item=0 name="pulse" inode=7340042 dev=fe:03 mode=040700 ouid=1001 ogid=1001 rdev=00:00 obj=system_u:object_r:unlabeled_t:s0 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0 Closes: sharkdp#880
Add the option on Unix systems to filter files by their inode number. The Windows equivalent FileIndex is not yet stabilized, see rust-lang/rust#63010. This is especially useful to debug audit records, e.g.: Jan 30 17:48:55 laptop audit: PATH item=0 name="pulse" inode=7340042 dev=fe:03 mode=040700 ouid=1001 ogid=1001 rdev=00:00 obj=system_u:object_r:unlabeled_t:s0 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0 Closes: sharkdp#880
Add the option on Unix systems to filter files by their inode number. The Windows equivalent FileIndex is not yet stabilized, see rust-lang/rust#63010. This is especially useful to debug audit records, e.g.: Jan 30 17:48:55 laptop audit: PATH item=0 name="pulse" inode=7340042 dev=fe:03 mode=040700 ouid=1001 ogid=1001 rdev=00:00 obj=system_u:object_r:unlabeled_t:s0 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0 Closes: sharkdp#880
Add the option on Unix systems to filter files by their inode number. The Windows equivalent FileIndex is not yet stabilized, see rust-lang/rust#63010. This is especially useful to debug audit records, e.g.: Jan 30 17:48:55 laptop audit: PATH item=0 name="pulse" inode=7340042 dev=fe:03 mode=040700 ouid=1001 ogid=1001 rdev=00:00 obj=system_u:object_r:unlabeled_t:s0 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0 Closes: sharkdp#880
Add the option on Unix systems to filter files by their inode number. The Windows equivalent FileIndex is not yet stabilized, see rust-lang/rust#63010. This is especially useful to debug audit records, e.g.: Jan 30 17:48:55 laptop audit: PATH item=0 name="pulse" inode=7340042 dev=fe:03 mode=040700 ouid=1001 ogid=1001 rdev=00:00 obj=system_u:object_r:unlabeled_t:s0 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0 Closes: sharkdp#880
Add the option on Unix systems to filter files by their inode number. The Windows equivalent FileIndex is not yet stabilized, see rust-lang/rust#63010. This is especially useful to debug audit records, e.g.: Jan 30 17:48:55 laptop audit: PATH item=0 name="pulse" inode=7340042 dev=fe:03 mode=040700 ouid=1001 ogid=1001 rdev=00:00 obj=system_u:object_r:unlabeled_t:s0 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0 Closes: sharkdp#880
Add the option on Unix systems to filter files by their inode number. The Windows equivalent FileIndex is not yet stabilized, see rust-lang/rust#63010. This is especially useful to debug audit records, e.g.: Jan 30 17:48:55 laptop audit: PATH item=0 name="pulse" inode=7340042 dev=fe:03 mode=040700 ouid=1001 ogid=1001 rdev=00:00 obj=system_u:object_r:unlabeled_t:s0 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0 Closes: sharkdp#880
Add the option on Unix systems to filter files by their inode number. The Windows equivalent FileIndex is not yet stabilized, see rust-lang/rust#63010. This is especially useful to debug audit records, e.g.: Jan 30 17:48:55 laptop audit: PATH item=0 name="pulse" inode=7340042 dev=fe:03 mode=040700 ouid=1001 ogid=1001 rdev=00:00 obj=system_u:object_r:unlabeled_t:s0 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0 Closes: sharkdp#880
Add the option on Unix systems to filter files by their inode number. The Windows equivalent FileIndex is not yet stabilized, see rust-lang/rust#63010. This is especially useful to debug audit records, e.g.: Jan 30 17:48:55 laptop audit: PATH item=0 name="pulse" inode=7340042 dev=fe:03 mode=040700 ouid=1001 ogid=1001 rdev=00:00 obj=system_u:object_r:unlabeled_t:s0 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0 Closes: sharkdp#880
Just a tip: there is now a crate named file-id for getting file ids. Its pub enum FileId {
Inode {
device_id: u64,
inode_number: u64,
},
LowRes {
volume_serial_number: u32,
file_index: u64,
},
HighRes {
volume_serial_number: u64,
file_id: u128,
},
} |
Add the option on Unix systems to filter files by their inode number. The Windows equivalent FileIndex is not yet stabilized, see rust-lang/rust#63010. This is especially useful to debug audit records, e.g.: Jan 30 17:48:55 laptop audit: PATH item=0 name="pulse" inode=7340042 dev=fe:03 mode=040700 ouid=1001 ogid=1001 rdev=00:00 obj=system_u:object_r:unlabeled_t:s0 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0 Closes: sharkdp#880
Add the option on Unix systems to filter files by their inode number. The Windows equivalent FileIndex is not yet stabilized, see rust-lang/rust#63010. This is especially useful to debug audit records, e.g.: Jan 30 17:48:55 laptop audit: PATH item=0 name="pulse" inode=7340042 dev=fe:03 mode=040700 ouid=1001 ogid=1001 rdev=00:00 obj=system_u:object_r:unlabeled_t:s0 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0 Closes: sharkdp#880
This is a tracking issue for APIs added in #62980, namely the following Windows-specific APIs:
The motivation of these accessors are that the standard library learns about them in its call to
GetFileInformationByHandle
but doesn't expose it from the standard library, which means consumers that want to learn this either need to reimplement the pieces in the standard library or execute a second syscall. Concrete motivation for these fields arose during CraneStation/wasi-common#42.These fields all return
Option
which is a bit odd, but there's a few way of learning about aMetadata
on Windows. When learned through aDirEntry
these fields aren't available but when learned through afs::metadata
call orFile::metadata
these fields are available. It's unfortunately not as uniform as Unix, but we don't have a ton of options as well.The text was updated successfully, but these errors were encountered: