http://qs321.pair.com?node_id=396052


in reply to opening the cd rom

Forgetting about the web part of the question first, let me note how to open the cdrom from a locally run program, in linux. I show this just because it's not obvious even this way.

{ use Fcntl; sysopen my $f, "/dev/hdc", O_RDONLY|O_NONBLOCK or die "open + $?"; ioctl $f, 0x5309, 0 or die "ioctl $!"; }

The trick here is to use O_NONBLOCK. You have to substitute "/dev/hdc" with the actual cdrom device of course. You can probably find it out with the {set,get,end}fsent C functions, but I don't know how to access those from perl.