Re: mounting cdrom within function system()

From: Arnoud (galactus_at_stack.nl)
Date: 10/28/04


Date: Thu, 28 Oct 2004 13:54:09 +0000 (UTC)

In article <clqucl$2pm7$1@news.hgc.com.hk>,
sam <samwun@hgcbroadband.com> wrote:
>> system("/sbin/mount -t cd9660 /dev/acd0 /cdrom");
>> or
>> system("/sbin/mount /cdrom");
>>
>> but it appeared failed to mount to the cdrom.
>> I have two commands executed manually, the cdrom is mountable.
>
>May be this is the reason:
># /bin/sh -c "/sbin/mount /cdrom"
>cd9660: /dev/acd0: No such file or directory

Usually you don't mount acd0 but acd0c. This might be the
cause of the error. But you get "no such file or directory"
which means acd0c does not exist. Is this right?

As to your first question, normally only root can mount
the cdrom. So the program that does the system() will need
to be run by root as well (or be setuid root).

What commands do you use normally to mount the cd-rom?

Arnoud

-- 
Arnoud Engelfriet, Dutch patent attorney - Speaking only for myself
Patents, copyright and IPR explained for techies: http://www.iusmentis.com/


Relevant Pages

  • Re: [opensuse] Re: k3b on suse 10.2: no devices
    ... mount a cdrom (as root, of course) before I can access it's contents as a ... You should absolutely not have to mount cdroms as ... In kde, all this is managed by KDED, which is ...
    (SuSE)
  • Re: [opensuse] Re: k3b on suse 10.2: no devices
    ... mount a cdrom before I can access it's contents as a ... You should absolutely not have to mount cdroms as root. ... In kde, all this is managed by KDED, which is configured from the Control Centre. ...
    (SuSE)
  • Cant mount cdrom anymore
    ... unstable, kernel 2.4.21, i686), I cannot mount my ATAPI cdrom drive (a ... I am not aware of having broken anything when I added the second hard ... even more so as I can mount/use this cdrom when running Knoppix ... lrwxrwxrwx 1 root root 9 Sep 17 16:34 cdrom -> /dev ...
    (Debian-User)
  • Re: SUCCESS AT LAST
    ... >> "If the game wants to run from the CD, then your problem is that you ... >> not mount the CDROM drive in the .conf file or manually. ... guess you have to do two separate lines for the two drives.. ...
    (comp.sys.ibm.pc.games.adventure)
  • Re: cant mount drive
    ... > through the driver that runs the device. ... > mulfunctioning or something else is fixing itself on the cdrom. ... When I bootup it is giving an error of mount fd type ro is not ... The author of cdrecord should not be bothered with problems in ...
    (Fedora)