Repository navigation
Carbon: move the File Manager to Swift over Graphite - #462
Merged
Merged
Conversation
… information to CoreServices
This was referenced Nov 26, 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.
Phase 2 of
Documentation/Plans/graphite.md, first of three PRs, against master:files.cmoves to Swift overGraphiteFiles(PureSwift/Graphite#12).Carbon
Sources/PerryCarbon/Files.swiftexports everythingfiles.cdid except the six below:PBReadAsyncincluded;PBGetCatInfo, the desktop database stubs and Launch Services.._nameAppleDouble file beside a file, orname.rsrc, and are written back there.files.copened them empty.FSpCreate, byFSCreateFileUnicodeandFSCreateDirectoryUnicodewith catalog information, and byFSSetCatalogInfo.PBGetCatInforeports it, with the resource fork's sizes.#and their ID.FSAllocateFork,FSReadFork,FSWriteFork,FSSetForkSizeandFSSetForkPositionare@DarwinC, so their 64-bit offsets arrive where Darwin passes them.FSAllocateFork's were in the wrong registers.files.cstays for the C build (Scripts/build-i386-carbon.sh,build-ppc-carbon.sh), fenced out of SwiftPM withPERRY_CARBON_SWIFTas phase 1's files are. Its packed structures move toPerryCarbon.h, and its bundle, disc and startup-volume lookups toplaces.c, which both builds share.The six duplicates
FSNewAlias,FSNewAliasMinimal,FSResolveAlias,FSResolveAliasWithMountFlags,GetAliasSizeandFSGetCatalogInfowere in bothfiles.cand CoreServices'FileManager.swift. They are now CoreServices' alone, in the C build too, and leaveexports.txt(572 → 566).FileManager.swift's versions move ontoGraphiteFiles:FSGetCatalogInfoexisted to make up for that. It also gives Finder info and the resource fork's sizes.'PRRY', path) and add the item's device and inode, so they find an item that moved. Records saved by the old code still resolve by path.Checks
PerryCarbonandPerryUniformTypeIdentifiers, no warnings in the new code.Scripts/check-carbon-exports.shpasses on both the SwiftPM library and the C-only one: 566 exports, as listed._system_get_ST_*C helpers, whichGraphiteFileslinks and no program binds to.