Hi, i am working on a swift package library that gets information about all the disks connected to the mac and displays it organised into a tree structure, including the non-mounted storage devices attached to the machine.
My question is how can i get informations about unmounted devices like:
- The amount of free space (when possible) of a partition or an APFS container
- The space occupied by a single APFS volume
I am already using a combination of IOKit and Disk Arbitration for my library and i don't see this information anywhere in those frameworks, including the description dictionaries provided by Disk Arbitration.
Instead the terminal command diskutil info -plist [volume/partition BSD name here]
gives me this info, but i can't just use it's output in my swift program (and obtaining it via a process object for example) since it doesn't work with the app sandbox, so i am looking for a sandbox-friendly way using just the API.
I hope you can help me figure this out, really any help is appreciated, thank you for your attention.