-
Notifications
You must be signed in to change notification settings - Fork 1.2k
FileManager: Implement mountedVolumeURLs(includingResourceValuesForKeys:options:) #1496
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
…ys:options:) - propertyKeys and options arent fully implemented. - Only works on Linux and macOS.
@swift-ci please test |
Neat |
cc @kperryua |
Foundation/FileManager.swift
Outdated
urls.append(URL(fileURLWithPath: mountPoint[1], isDirectory: true)) | ||
} | ||
} | ||
#elseif os(macOS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use canImport(Darwin) here instead? I'm ok with os(Linux) for the above because /proc/mounts is explicitly a Linux feature, but I'd rather not tie one Darwin API to a specific OS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also half-thinking whether we also need to start using:
#else
#error("Requires a platform-specific implementation")
#endif
now that we do have #error
.
- Add #error for non Linux/Darwin implementations, to be filled in later.
@swift-ci please test |
@millenomi I added both of those changes although the |
@swift-ci please test |
@spevans I think I want to push standardizing on canImport(Darwin) in the rest of corelibs-foundation, too. (i.e.: if it's a Darwin-based OS, we should ask if Darwin API are available, not which particular flavor of OS it is.) |
@swift-ci please test and merge |
1 similar comment
@swift-ci please test and merge |
propertyKeys and options arent fully implemented.
Only works on Linux and macOS.