01-17-2004
9,926,
461
Join Date: Aug 2001
Last Activity: 26 February 2016, 12:31 PM EST
Location: Ashburn, Virginia
Posts: 9,926
Thanks Given: 63
Thanked 461 Times in 270 Posts
fpmurphy, that link did not work for me.
massimo_rati, you cannot have a process magically spring into existence because a cd has been inserted. You can write a daemon that will notice a cd insertion. SunOS comes with a volume manager that notices cd insertions and mounts the cd. Other versions of unix might have something similiar. This would be a problem for you. Most likely, only one such program could be running.
How this works will depend on the cd driver. You need to find the docs for your cd driver and read them.
Ideally, you will simply use open(2) on the device file for the cd. And you will not use O_NONBLOCK nor O_NDELAY. Thus the open will block until the device is ready.
But anything is possible. You're at the mercy of the driver's author.