Physical written-protected disk like SDCard can update the value of "Media Read-Only", may I ask if there is any API could modify this value when recognising a mounting event? I am trying to not allow erasing my USB when it is mounted with read-only permission, thank you.
Is it possible to set kDADiskDescriptionMediaWritableKey programmatically
You can’t modify that value. It’s intended to reflect the state of the media itself.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"