From: Detlef Reichl Date: 2009-05-22T06:14:15+09:00 Subject: Re: cdrom control and detection Hi, Mk 27 schrieb: > David Thurston wrote: > > > How do I detect that the user has inserted the next cd so that my > > program can continue cataloging cd contents? > > You could do a loop with mount, system will return true if it succeeds > (and false if it fails!). However, that is not a very nice idea unless > you really, really want to completely minimize user interaction to > nothing. I'd recommend something like: better than polling the mount directory would be to observe it with inotify http://raa.ruby-lang.org/project/ruby-inotify/ Because, this library includes a smal implementation error, you should take a look at http://www.mindbucket.com/2009/02/24/ruby-daemons-verifying-good-behavior/ and make the suggested change to the source before compile. Cheers, detlef -- http://det.cable.nu