iso9660: expose rich metadata via FileInfo.Sys()#394
Merged
Conversation
Returns a *StatT from directoryEntry.Sys() carrying ISO9660 fields (ExtAttrSize, Location, VolumeSequence, IsHidden, IsAssociated, HasExtendedAttrs, HasOwnerGroupPermissions) and, when present, Rock Ridge fields parsed from PX and SL records (UID, GID, NLink, Inode, LinkTarget, RockRidge). Refs diskfs#301
Collaborator
|
This is fine and makes sense. I have no issue with deprecating 2 issues:
|
Contributor
Author
|
I will address your feedback later tonight |
Per review feedback, keep the directoryEntry method alongside the type's other methods. StatT struct stays in fileinfo.go.
Contributor
Author
|
Moved |
deitch
approved these changes
May 15, 2026
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.
Refs #301. Sibling of #393 (ext4) — same pattern, applied to iso9660.
What this does
filesystem/iso9660/directoryEntry.Sys()previously returned*RockRidgeInfowhen Rock Ridge extensions were present on the entry, otherwisenil. That was a partial answer to #301: callers could only see uid/gid/mode/symlink, only on Rock Ridge ISOs, and the plain ISO9660 metadata (extent location, volume sequence, hidden flag, etc.) was invisible.This PR replaces
RockRidgeInfowith a richeriso9660.StatTthatSys()always returns, carrying both the plain ISO9660 directory-entry fields and the Rock Ridge fields when present.Fields
ExtAttrSize uint8Location uint32(extent LBA)VolumeSequence uint16IsHidden boolIsAssociated boolHasExtendedAttrs boolHasOwnerGroupPermissions boolUID uint32GID uint32NLink uint32Inode uint32LinkTarget stringRockRidge boolRR fields are zero-valued /
RockRidge=falseon non-RR ISOs.Breaking change —
RockRidgeInforemovedRockRidgeInfowas added recently (in #353) and exported, so removing it is a breaking change. In-repo callers in 4 test files are updated as part of this PR. External callers will need to switch:The alternative — keeping
RockRidgeInfoalongside the newStatT— would have left two competing return types forSys()and split the metadata model in two. Given thatRockRidgeInfois fresh (one release) and only covers a subset of what callers actually want, supersession seems cleaner than coexistence. Open to keeping it as a deprecated alias if reviewers prefer.Tests
New
TestSysStatT(plain ISO viatestdata/9660.iso) andTestSysStatTRockRidge(RR ISO viatestdata/rockridge.iso). Existing Rock Ridge tests (combined_xorriso_test.go,finalize_test.go,rockridge_xorriso_test.go) updated to assert on*StatTinstead of*RockRidgeInfo.