-
Notifications
You must be signed in to change notification settings - Fork 724
Add homeDirectory accessor to FileSystem #3471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e087a29 to
8de0f7e
Compare
8de0f7e to
e573fb8
Compare
e573fb8 to
302328f
Compare
302328f to
38db47d
Compare
|
rebased to master. @Lukasa shoudl i be worried about this in ci? 1 breaking change detected in _NIOFileSystem: |
|
No, this is acceptable. |
|
@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) |
|
API breakage is expected, merging over it. |

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.