Skip to content

Add Graphite-owned PBGetCatInfo on every volume - #43

Merged
colemancda merged 4 commits into
masterfrom
feature/catalog-info
Dec 1, 2026
Merged

colemancda merged 4 commits into
masterfrom
feature/catalog-info

Conversation

@colemancda

Copy link
Copy Markdown
Member

Adds catalog information for items on both the POSIX volume and snapshot-catalog volumes, so BlueBox can ask about an application's own files (types, creators, fork sizes) through the File Manager.

CInfoPBRec

  • CatalogInfoParam keeps the 108-byte record as guest bytes, with typed accessors for the shared fields and for both the HFileInfo and DirInfo variants, which overlap from byte 52. Offsets come from Retro68's Multiversal headers via the compiler.
  • The data and resource fork lengths at bytes 54, 58, 64 and 68 are only two-byte aligned, so every field is read and written a byte at a time.
  • results writes back everything but the program's own ioFDirIndex, or only ioResult when the call fails.

PBGetCatInfo (FileSystem.getCatalogInfo)

  • Choosing the item: a negative index means folder ioDirID itself, and returns its name. A positive index means that position in the folder, returns the item's name, and is fnfErr past the end. Index 0 means the item the name gives, resolved like FSMakeFSSpec including partial pathnames; an empty name is the folder.
  • What it reports: the directory and locked attribute bits, the item's ID and parent ID, Finder info, logical and physical fork lengths (physical rounded up to 512 bytes), a folder's item count, and dates.
  • Errors are fnfErr, dirNFErr and nsvErr, and asynchronous calls name their completion routine.
  • Volumes: FileSystem.catalogInfo(volume:directory:name:index:) routes to the right volume. On a catalog it uses the new SnapshotCatalog.catalogInfo(_:) and item(at:inFolder:); on POSIX it uses the existing path-based CatalogInfo.

Reviewer notes

Tests

CatalogInformationTests cover the record layout and unaligned fields, write-back fields, files and folders by name, index and folder, missing items, POSIX items, and completion routines. All package tests pass.

@colemancda
colemancda merged commit aa7c08d into master Dec 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant