Add homeDirectory accessor to FileSystem#3471
Merged
Lukasa merged 3 commits intoapple:mainfrom Jan 12, 2026
Merged
Conversation
Lukasa
reviewed
Jan 2, 2026
e087a29 to
8de0f7e
Compare
Lukasa
reviewed
Jan 2, 2026
8de0f7e to
e573fb8
Compare
Lukasa
reviewed
Jan 5, 2026
e573fb8 to
302328f
Compare
302328f to
38db47d
Compare
Contributor
Author
|
rebased to master. @Lukasa shoudl i be worried about this in ci? 1 breaking change detected in _NIOFileSystem: |
keetsta
approved these changes
Jan 6, 2026
Contributor
|
No, this is acceptable. |
Contributor
Author
Lukasa
approved these changes
Jan 8, 2026
Contributor
Author
|
@Lukasa just to confirm this will get auto merged the next time swift nio has a semver minor or major right? (sorry if this is too basic of question to ask, but im just confused) |
Contributor
|
API breakage is expected, merging over it. |
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.

Add homeDirectory accessor to FileSystem
Motivation:
Addresses #3381 by adding a
homeDirectoryproperty to FileSystem, equivalent toFileManager.default.homeDirectoryForCurrentUser.Modifications:
homeDirectoryproperty toFileSystemProtocoland implemented inFileSystemHOMEenvironment variable first, falls back toUSERPROFILEon Windows, or usesgetpwuid_r(3)on POSIX systemssystem_getuid,libc_getpwuid_r) with proper platform guardsFileSystemError.getpwuid_r()error helperResult:
Users can now access the home directory via
FileSystem.homeDirectory, returning aFilePathasynchronously. Follows the same pattern ascurrentWorkingDirectoryandtemporaryDirectory.