about control the cdrom drive - Linux

This is a discussion on about control the cdrom drive - Linux ; Hi, all, Now, there are some files saved in 4 CD and every CD has one serial number which is saved in one file in the CD. The info file saves concerned information, includes the relative path of each file, ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: about control the cdrom drive

  1. about control the cdrom drive

    Hi, all,
    Now, there are some files saved in 4 CD and every CD has one serial
    number which is saved in one file in the CD. The info file saves
    concerned information, includes the relative path of each file, the CD
    number of each file. I read and parse the info file, then read these
    files from corresponding CD according their cd number and relative
    path.
    My question is how can I pop up the cdrom and ask the user to inject
    the second CD after I dealing with the first CD. this is similar to the
    installation CD of linux operating system. Could anyone help me?
    Thanks.

    Best Regards.

    Tony


  2. Re: about control the cdrom drive

    sunnyboyGuo@gmail.com wrote:
    > Hi, all,
    > Now, there are some files saved in 4 CD and every CD has one serial
    > number which is saved in one file in the CD. The info file saves
    > concerned information, includes the relative path of each file, the CD
    > number of each file. I read and parse the info file, then read these
    > files from corresponding CD according their cd number and relative
    > path.
    > My question is how can I pop up the cdrom and ask the user to inject
    > the second CD after I dealing with the first CD. this is similar to the
    > installation CD of linux operating system. Could anyone help me?
    > Thanks.


    Have a look at the "eject" program.
    After having ejected the CD, you could open it using O_NDELAY to see
    when a new disk is inserted.
    --
    Josef Mllers (Pinguinpfleger bei FSC)
    If failure had no penalty success would not be a prize
    -- T. Pratchett


  3. Re: about control the cdrom drive

    On 2006-12-20, sunnyboyGuo@gmail.com wrote:
    > Hi, all,
    > Now, there are some files saved in 4 CD and every CD has one serial
    > number which is saved in one file in the CD. The info file saves
    > concerned information, includes the relative path of each file, the CD
    > number of each file. I read and parse the info file, then read these
    > files from corresponding CD according their cd number and relative
    > path.
    > My question is how can I pop up the cdrom and ask the user to inject
    > the second CD after I dealing with the first CD. this is similar to the
    > installation CD of linux operating system. Could anyone help me?
    > Thanks.


    There's a program called "eject" to do that. (it can also close the tray
    etc...)

    --

    Bye.
    Jasen

  4. Re: about control the cdrom drive

    Thanks all of you. I will download and learn the "eject" program.

    Regards.
    Tony

    "jasen д
    "
    > On 2006-12-20, sunnyboyGuo@gmail.com wrote:
    > > Hi, all,
    > > Now, there are some files saved in 4 CD and every CD has one serial
    > > number which is saved in one file in the CD. The info file saves
    > > concerned information, includes the relative path of each file, the CD
    > > number of each file. I read and parse the info file, then read these
    > > files from corresponding CD according their cd number and relative
    > > path.
    > > My question is how can I pop up the cdrom and ask the user to inject
    > > the second CD after I dealing with the first CD. this is similar to the
    > > installation CD of linux operating system. Could anyone help me?
    > > Thanks.

    >
    > There's a program called "eject" to do that. (it can also close the tray
    > etc...)
    >
    > --
    >
    > Bye.
    > Jasen



  5. Re: about control the cdrom drive


    "jasen д
    "
    > On 2006-12-20, sunnyboyGuo@gmail.com wrote:
    > > Hi, all,
    > > Now, there are some files saved in 4 CD and every CD has one serial
    > > number which is saved in one file in the CD. The info file saves
    > > concerned information, includes the relative path of each file, the CD
    > > number of each file. I read and parse the info file, then read these
    > > files from corresponding CD according their cd number and relative
    > > path.
    > > My question is how can I pop up the cdrom and ask the user to inject
    > > the second CD after I dealing with the first CD. this is similar to the
    > > installation CD of linux operating system. Could anyone help me?
    > > Thanks.

    >
    > There's a program called "eject" to do that. (it can also close the tray
    > etc...)
    >
    > --
    >
    > Bye.
    > Jasen


    Thank you very much.
    Now in my program, it exec "eject" command to eject the CDROM, it
    can work, but I across with a new problem. The user may run my program
    under /mnt/cdrom, now the shell's current working directory is
    /mnt/cdrom. In this case, "eject" cannot umount the CDROM because
    it's busy. If the user start my program in background, and then
    change the shell's current working directory to other place,
    "eject" can work well. But I think this is not convenient for
    users. So I'd like to consult if there is one more convenient method
    that the program can do necessary work for ejecting the CDROM, and
    don't depend on how the user start up the program. If it kill the
    parent shell, the output of my program cannot be showed for user.
    Ooh, Could you give me some suggestion?.

    Best Regards!
    Tony


+ Reply to Thread