1

I am wondering how to be notified when a mass storage device is plugged (or unplugged) to the Mac.

Quinn Taylor
  • 44,553
  • 16
  • 113
  • 131
AP.
  • 5,205
  • 7
  • 50
  • 94

1 Answers1

4

If you're writing a Cocoa app you can register for NSWorkspace notifications that fire when disks are mounted or unmounted.

At a lower level (more appropriate if you're writing a daemon or NSWorkspace doesn't give you enough information) you can use the Disk Arbitration Framework.

Nicholas Riley
  • 43,532
  • 6
  • 101
  • 124