Skip to main content

Utilities to work with disks on macOS

Project description

Utilities to work with disks on macOS

Specifics

This library provides some functions for working with disks and mountpoints on macOS. It can enumerate block devices and look up the mount points for attached media.

The code is tested with Python 2.7 and 3.6.

Requirements

My macOS API binding library rh.osx is required.

Examples

>>> import rh.osxdiskutils
>>> all_drives = rh.osxdiskutils.find_block_devices()
>>> for drive in all_drives:
...     all_media = rh.osxdiskutils.find_media(drive)
...     for media in all_media:
...         bsd_name = rh.osxdiskutils.get_bsd_name(media)
...         mount_point = rh.osxdiskutils.get_mount_point(bsd_name)
...         if mount_point:
...             print(bsd_name, mount_point)
...
disk1 /
disk6 /Volumes/Storage
disk8 /Volumes/Storage2
disk7 /Volumes/Storage3

License

This library is distributed under the MIT license, as described in the LICENSE file.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rh.osxdiskutils-0.1.tar.gz (3.2 kB view details)

Uploaded Source

File details

Details for the file rh.osxdiskutils-0.1.tar.gz.

File metadata

File hashes

Hashes for rh.osxdiskutils-0.1.tar.gz
Algorithm Hash digest
SHA256 597194e03693cc35dc90b8a75c52bccd2a50847b81dd0de2719962c015ab6e01
MD5 72d9d79bca399c6da6dee9bd5d190c23
BLAKE2b-256 c57463fca3dc1010194c35c1c45970298c2e1faa35b675dc222b9889b3127e87

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page