Conversation
sylvestre
reviewed
Sep 20, 2026
| 'x' => OutputType::Str(pretty_time(meta, MetadataTimeField::Access)), | ||
| // time of last access, seconds since Epoch | ||
| 'X' if flag.nanoseconds => { | ||
| let (_, nsec) = metadata_get_time(meta, MetadataTimeField::Access) |
Contributor
There was a problem hiding this comment.
could be dedup, no ?
almost the same code 3 times
krosci
force-pushed
the
fix/stat-nanosecond-formats
branch
from
September 20, 2026 15:19
7d2fd23 to
9f87ed6
Compare
sylvestre
reviewed
Sep 20, 2026
|
|
||
| const PRETTY_DATETIME_FORMAT: &str = "%Y-%m-%d %H:%M:%S.%N %z"; | ||
|
|
||
| fn time_field(format: char) -> MetadataTimeField { |
Contributor
There was a problem hiding this comment.
seems like a too generic function name here
Contributor
Author
There was a problem hiding this comment.
What should I name it?
|
GNU testsuite comparison: |
krosci
force-pushed
the
fix/stat-nanosecond-formats
branch
from
September 21, 2026 12:51
9f87ed6 to
d833607
Compare
krosci
force-pushed
the
fix/stat-nanosecond-formats
branch
from
September 21, 2026 16:09
d833607 to
ca29240
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change resolves stat-nanoseconds.sh from the GNU 9.12 test suite tracked in #14705 by implementing the nanosecond format directives %:X, %:Y, %:Z, and %:W. These specifiers format the timestamp nanosecond component as a 9-digit zero-padded string while honoring width and alignment flags. Automated tests have been added to verify output formatting and error handling.