How to burn a CD/DVD in linux using C++

m-jeri

A Nobody.
Skilled
My needs are

A DVD+RW is there

1. Detect the type of media inserted ... CD or DVD be enuff.....
2. Write a File or Content of folder to it.... using C++..

I cant use the command line options using System call...need lots of writing info...so that i can have a progress bar...

links also be nice...

Jerin
 
phew....

didnt expect these answers..... lolz...

I know command like cdrecord..mkisofs...frowisofs... then K3b and all.... and i know how to use them in system call in c++..but thats not good enuff for me

I need to write my own burning program.... tried looking up k3b source..but i cant figure it out.... looks like a complex factory architecture...

By the looks no one knows the method..thnx for looking.....
 
If you tried looking K3b sources youy won't get anything.. Open the files after installing Qtsoftware and then see through it..

You can use QT for KDE based and GTK/Glade for Gnome based in creating interface.. For source look for K3b and brasero files..
 
^^

right now looking through brasero...k3b i gave up...

for interface i am using QT creator from nokia....
 
Any ideas or samples..on how to burn just a data file.or a folder to a CD using c++.....thats all i need....
 
Quite simple, then

Just open the DVD R/W Device File. (You know that in Unix like, all devices are files.)

Write data to this file. Close it.

And I think DVD won't work, since you are writing RAW data, you need to create a file system on the disk and there are lots of things like ISO, UDF dvd file systems. And it needs to be compliant if you want your DVD to read it.

That's all.
 
^^^

can you give a sample code???...

I can open by

int fd;

char* pszDevName = "/dev/cdrom";

if(( fd = open( QFile::encodeName( pszDevName ), O_RDONLY|O_NONBLOCK)) == -1)

{

//return -1;

}

and do some stuff like CD eject or close...

if(ioctl(fd, CDROMEJECT) == -1)

{

//return -1;

}

else

{

//close(fd);

}

can you give a sample on how to actually write a folder to it???
 
I think k3b source (was recently browsing their SVN repo looking for KDE4 updates) uses those tools like dvdrwtools, cdrecord, cdrdao, mkisofs, growisofs etc... it just launches the processes with arguments and reads the output... k3b is just a UI frontend for those tools..

Since those tools themselves are open source just download THEM rather than looking at burning programs like k3b or brasero... :)
 
vishalrao said:
I think k3b source (was recently browsing their SVN repo looking for KDE4 updates) uses those tools like dvdrwtools, cdrecord, cdrdao, mkisofs, growisofs etc... it just launches the processes with arguments and reads the output... k3b is just a UI frontend for those tools..

Since those tools themselves are open source just download THEM rather than looking at burning programs like k3b or brasero... :)

+1 Agreed. It as far as I know doesnt do its own API calls.

~LT
 
Or if anyone can point me a library which i can include to burn the CD or DVD be also useful..

so that i juzt use that
 
I really don't know.

Its not that quite simple,

how can you create a directory without first creating a file system on the disk ?

Device programming is not like Application programming ! you have to know the details and stuff about the device !!
 
^^^

well that code for accesing the drice works..i can eject and close and all...

right now i think ill go with some shell calls....

in the mean time...ideas are welcome...

LOVE WINDOWS..THEY ARE SO DAMN ROBUST
 
Back
Top