Hello Quinn,
Thank you for taking the time to help and for asking for clarification. I appreciate your support.
The automation is written in Python. So far, the approach has been to call macOS command-line tools and interpret their output. However, I would prefer to use supported native APIs where these provide a more reliable answer.
Would a small Swift command-line helper, called by Python, be an appropriate approach? The helper could use Disk Arbitration and Foundation URL resource values, then return a small structured result to Python.
For example, after the user manually unlocks an encrypted sparsebundle, the helper would check:
Whether the mounted destination belongs to the intended disk image.
Whether it is mounted read/write and ownership is enforced.
Whether its identity is still consistent immediately before copying.
The checks should be read-only. They should not unlock or mount images, change permissions, or alter security settings. Missing or conflicting information should produce an “unknown” result, and Python would stop rather than copy.
Would you recommend this Python-plus-Swift arrangement? If so, which APIs would you suggest for establishing the image-to-volume relationship and reducing the risk of the destination changing between checking and copying?
Thank you again for your guidance.
Topic:
App & System Services
SubTopic:
Core OS
Tags: