Documentation
¶
Overview ¶
Package disk provides helpers for managing macOS disk images via hdiutil.
It can query whether a disk image is currently attached, detach it safely with escalating retry strategies, and poll until a disk becomes available after a VM stops.
All operations shell out to hdiutil and diskutil; no cgo or framework bindings are required.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureDetached ¶
EnsureDetached detaches diskPath if it is currently attached. Returns nil immediately if the disk is not attached. On failure, returns an error with manual-fix instructions.
func FindAttachedDisk ¶
FindAttachedDisk checks whether diskPath is currently attached via hdiutil. If found, it returns the /dev/diskN device identifier. If the disk is not attached, found is false and err is nil. err is non-nil only when hdiutil info itself fails.
func StillAttached ¶
StillAttached reports whether diskPath is currently attached.
Types ¶
This section is empty.