How can I find the mounted storage devices and get information about them ? Basically I want a similar behavior like in the finder sidebar.
***Update: Generally I need to show the devices names and types
At the moment I am looking into the /Volumes/ directory and just list whats in there, but that leaves me with 2 problems:
The second problem is really bugging me. If I could identify the item, I could also sort out the unwanted items, but I do not even know if it is a mounted DMG, USB device, or network device.
I already looked at a few examples, but not getting anywhere. The apple sample FSMegaInfo, already gives a bit information, but does I am not sure if I am able to identify the type of device. I am also not sure how I get the required information to scan the device. Also DADiskCopyDescription does not seem to give me the required information.
I also use the NSWorkspace notification to get information about new mounted or unmounted devices, but the notification event does not really provide any information.
Is there no easy way ?
Thanks for the help.
Seb
Ask an NSFileManager object what volumes are mounted.
Use this: -[NSFileManager mountedVolumeURLsIncludingResourceValuesForKeys:options:]
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With