What's more precisely the problem ?
There are 2 functions to find the volumes.
Returns an array of URLs that identify the mounted volumes available on the device.
Once you have their URL, you can search for their directory… But may be I misunderstood your question.
Need to know how to … get the root folder
For a file system URL, you can get the root of the volume using the
.volumeURLKey. For example:
let u = URL(fileURLWithPath: "/Volumes/SDKCentral/MacOSX10.14.sdk/", isDirectory: true) let info = try u.resourceValues(forKeys: [.volumeURLKey]) print(info.volume!) // prints: file:///Volumes/SDKCentral/
check if files or directories are on same volume
The canonically correct way to do this is with
There’s nothing special here;
FileManagerwill just as easily copy between volumes as it does within a volume.
move from one to another etc?
FileManagerwill also move between volumes. Be aware that this is not supported directly by the underlying file system. To accomplish this,
FileManagerdoes a copy then delete.
Share and Enjoy
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"
Thanks for the responses, has been helpful.