Re: How do you use 'cdrw' within an application?
From: Joerg Schilling (js_at_cs.tu-berlin.de)
Date: 12/02/03
- Previous message: Logan Shaw: "Re: How do you use 'cdrw' within an application?"
- In reply to: Logan Shaw: "Re: How do you use 'cdrw' within an application?"
- Next in thread: Noel R. Nihill: "Re: How do you use 'cdrw' within an application?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 2 Dec 2003 10:09:29 GMT
In article <DnQyb.69828$Ek.60053@twister.austin.rr.com>,
Logan Shaw <lshaw-usenet@austin.rr.com> wrote:
>M Sudderth wrote:
>
>> I'm using a Plextor PX-W1210TSE CD-RW drive on a Solaris 8 system.
>>
>> I'm writing an application in C++ and need to be able to burn
>> files/image to a CD from within the application.
>>
>> 'cdrw' may be able to be used, but it's a command-line command. I may
>> be able to use the "system" operation:
>> i.e.
>> system("mkisofs -r <directory> 2>/tmp/cdrw_log | cdrw -i -p 4");
>>
>> But errors can not be returned to the calling application. This will
>> only
>> work in the "happy day" scenario.
>
>The proper thing to do would be to create a pipe using pipe().
>Then, for mkisofs, do a fork() and connect the child process's
>input to /dev/null and stdout to the input end of the pipe
>(and close the output end of the pipe in that process). Then
....
>From listening to some problems with cdrw in the past, it seems that
"cdrw" does not necessarily print an error message when something
did go wrong. I am not sure if the exit code will be != 0 in such
a case....
cdrecord will always print a readable error message and exit != 0
if there was an error. Installing a recent cdrtools package (current
is 2.01a19) grants you also that you use a recent and best bug free
version of mkisofs. Note that even the next version of Solaris 9
will include only mkisofs-1.14 which is now more than 2 years old.
Be sure that you use the mkisofs that comes with the cdrtools package
and not /usr/bin/mkisofs
P.S. meet me at SunNetwork in Berlin
--
EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
js@cs.tu-berlin.de (uni) If you don't have iso-8859-1
schilling@fokus.fraunhofer.de (work) chars I am J"org Schilling
URL: http://www.fokus.fraunhofer.de/usr/schilling ftp://ftp.berlios.de/pub/schily
- Previous message: Logan Shaw: "Re: How do you use 'cdrw' within an application?"
- In reply to: Logan Shaw: "Re: How do you use 'cdrw' within an application?"
- Next in thread: Noel R. Nihill: "Re: How do you use 'cdrw' within an application?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|