Is it possible to set kDADiskDescriptionMediaWritableKey programmatically

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.

Answered by DTS Engineer in 741559022

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"

Accepted Answer

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"

Is it possible to set kDADiskDescriptionMediaWritableKey programmatically
 
 
Q