Skip to content

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

Merged
merged 2 commits into from
Apr 3, 2018

Conversation

spevans
Copy link
Contributor

@spevans spevans commented Mar 31, 2018

  • propertyKeys and options arent fully implemented.

  • Only works on Linux and macOS.

…ys:options:)

- propertyKeys and options arent fully implemented.

- Only works on Linux and macOS.
@spevans
Copy link
Contributor Author

spevans commented Mar 31, 2018

@swift-ci please test

@parkera
Copy link
Contributor

parkera commented Apr 2, 2018

Neat

@parkera
Copy link
Contributor

parkera commented Apr 2, 2018

cc @kperryua

urls.append(URL(fileURLWithPath: mountPoint[1], isDirectory: true))
}
}
#elseif os(macOS)
Copy link
Contributor

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.

Copy link
Contributor

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.
@spevans
Copy link
Contributor Author

spevans commented Apr 3, 2018

@swift-ci please test

@spevans
Copy link
Contributor Author

spevans commented Apr 3, 2018

@millenomi I added both of those changes although the canImport(Darwin) does feel a bit hacky.

@spevans
Copy link
Contributor Author

spevans commented Apr 3, 2018

@swift-ci please test

@millenomi
Copy link
Contributor

millenomi commented Apr 3, 2018

@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.)

@millenomi
Copy link
Contributor

@swift-ci please test and merge

1 similar comment
@spevans
Copy link
Contributor Author

spevans commented Apr 3, 2018

@swift-ci please test and merge

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.

4 participants