Expand description
NTFS volume discovery via diskutil list -plist + mount.
diskutil list -plist emits a nested plist document whose top-level
is a dict with an AllDisksAndPartitions array. Each entry is a
whole-disk record containing a nested Partitions array. Partitions
carry only Content, DeviceIdentifier, DiskUUID, and Size —
no mount point or volume name. Those are recovered by cross-referencing
the mount command output, which is cheap (one subprocess) and avoids
N+1 diskutil info calls.
Structs§
- Volume
- A discovered NTFS volume/partition.
Functions§
- enrich_
with_ mounts - Fill in
mounted,mount_point, andvolume_nameon each volume using the device→mount-point map produced byparse_mount_output. - list_
volumes - List all NTFS volumes visible to macOS.
- parse_
diskutil_ plist - Parse the plist output of
diskutil list -plist. - parse_
mount_ output - Parse the output of the
mountcommand into a map of device identifier → mount point. - pretty_
size - Format a byte count as
1.2 GiB.