Quote:
Originally Posted by kovidgoyal
Notification isn't enough what if the device was attached before the app is started. Also notification requires an apple event loop running whereas my app has a qt event loop. Doubt they'd be enough. Also detecting by path is inadequate, especially in the case of the storage card as that may not have any directory structure if it has been inserted for the first time.
|
...and as an experienced OS X programmer, these are all trivial case, really.
on launch, you check the mounted volumes, of course
The PRS-505 actually comes up in the device registry a couple of different ways and the SD comes up listed separate from the internal memory as a different device.
os x provides a shell tool call ioreg that lasts these; grepping the output for the 505 show them. it tells you the "BSD Device" is a quasi abstract way but its still a bit indirect without fooling around in iokit.
It i were doing this, I'd simply have the user "tag" and SD they wanted to use with the app; this way they could manage the content even if the reader wasn't plugged in.
But that's just me