[Udpcast] Ejecting the CD-ROM before broadcast

Thomas Kuehling thomas.kuehling at mapsolute.com
Thu Jun 22 10:29:24 CEST 2006


Hi Yannick,

i am not really fit in C, but on Linux it's enough to do just an eject
without addressing the device. Just type in the bash "eject" and the
device will be ejeceted.

On Mi, 2006-06-21 at 18:45 -0400, Yannick Gingras wrote:
> Hi, I'd like to have my udpcast to eject its CD-ROM before a broadcast
> so I can pick it and boot another box with it.  Yeah I could just push
> the CD-ROM drive button but I'm a lazy bum.  cast-o-matic is a great
> tool so I though I could just upload eject and call it.  Ok eject is
> overkill, I did a smaller eject that I call miniject:
> 
>    #include <unistd.h>
>    #include <stdlib.h>
>    #include <stdio.h>
>    #include <string.h>
>    #include <fcntl.h>
>    #include <limits.h>
>    #include <sys/ioctl.h>
>    #include <linux/cdrom.h>
>    
>    #define DEF_CDROM "/dev/cdrom"
>    
>    int main(int argc, char **argv)
>    {
>      int fd;
>      if (argc > 1)
>        fd = open(argv[1], O_RDONLY|O_NONBLOCK);
>      else
>        fd = open(DEF_CDROM, O_RDONLY|O_NONBLOCK);    
>      ioctl(fd, CDROMEJECT);
>    }
>    
> But unfortunatly I can't find the cdrom device in /dev.  Are there any
> modules that I should add to the image in order to have the cdrom
> device created in /dev ?
> 

Mit freundlichen Grüßen
Thomas Kühling

-- 
Mapsolute Gmbh - Techn. Administration - TK2325-RIPE
Düsseldorfer Straße 40a - 65760 Eschborn/Frankfurt a.M. - Germany 
E-Mail: thomas.kuehling at mapsolute.com - web: http://www.mapsolute.com




More information about the Udpcast mailing list