Skip to content

shims::fs adding more fields to FileMetadata #4444

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

Merged
merged 2 commits into from
Jul 5, 2025

Conversation

devnexen
Copy link
Contributor

@devnexen devnexen commented Jul 5, 2025

addressing, partially at least, FIXME comment and
targetting unixes, adding device, user and group ids.

Fixes #4379

@devnexen devnexen marked this pull request as draft July 5, 2025 04:12
@devnexen devnexen force-pushed the filemetadata_upd branch from 2f2e7a7 to 32c0974 Compare July 5, 2025 04:45
@devnexen devnexen marked this pull request as ready for review July 5, 2025 04:45
@devnexen devnexen force-pushed the filemetadata_upd branch from 32c0974 to c7b21c7 Compare July 5, 2025 04:58
@@ -1601,6 +1610,32 @@ impl FileMetadata {
let modified = extract_sec_and_nsec(metadata.modified())?;

// FIXME: Provide more fields using platform specific methods.
interp_ok(Ok(FileMetadata { mode, size, created, accessed, modified }))

#[cfg(unix)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rearrange this so that not all the fields need to be repeated everywhere. You can use cfg_select! to insert let-bindings into the surrounding scope like here.

@RalfJung
Copy link
Member

RalfJung commented Jul 5, 2025

Thanks! I left a comment for reducing code duplication. :)

@rustbot author

@rustbot
Copy link
Collaborator

rustbot commented Jul 5, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-waiting-on-author Status: Waiting for the PR author to address review comments label Jul 5, 2025
addressing, partially at least, FIXME comment and
targetting unixes, adding device, user and group ids.
@devnexen devnexen force-pushed the filemetadata_upd branch from 756e1eb to fe41b77 Compare July 5, 2025 09:10
@devnexen
Copy link
Contributor Author

devnexen commented Jul 5, 2025

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Waiting for a review to complete and removed S-waiting-on-author Status: Waiting for the PR author to address review comments labels Jul 5, 2025
@RalfJung
Copy link
Member

RalfJung commented Jul 5, 2025

Thanks! I did some more minor cleanup, that's easier than trying to explain it via comments. :) Please take a look, could be useful feedback for future PRs.

@RalfJung RalfJung enabled auto-merge July 5, 2025 09:41
@RalfJung RalfJung added this pull request to the merge queue Jul 5, 2025
Merged via the queue into rust-lang:master with commit 9d77dd8 Jul 5, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Waiting for a review to complete
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Miri does not support uid, gid, and several other metadata fields
3 participants