Executing cdrtools commands from java.

T

Toni

I would like to execute cdrtools commands like cdrecord to burn a cd
from java. Anyone has a previous experience with such a thing. Please
share everything you know about the subject.
 
P

Paul Lutus

Toni said:
I would like to execute cdrtools commands like cdrecord to burn a cd
from java. Anyone has a previous experience with such a thing. Please
share everything you know about the subject.

Please explain why you want to do this. Have you tried:

Runtime.getRuntime().exec("cdrecord ...");
 
T

Toni

Well I tried this but it didn't work for me, can you elaborate more
with an ex I am getting an error when trying to execute this. My OS is
windows XP pro and not Unix or Linux and I want to do this because I
need to add a cd burning feature for another project I have.
 
M

Michael Borgwardt

Toni said:
Well I tried this but it didn't work for me, can you elaborate more
with an ex I am getting an error when trying to execute this.

Can *you* elaborate more? Because without that, we can't.
 
P

Paul Lutus

Toni said:
Well I tried this but it didn't work for me, can you elaborate more
with an ex I am getting an error when trying to execute this.

What error, and when you try to execute what? My example was a generic one,
you were supposed to fill in the blanks. I cound not provide specific
details, because you have not provided specific details.
My OS is
windows XP pro and not Unix or Linux and I want to do this because I
need to add a cd burning feature for another project I have.

So post more details and someone here may be able to help.
 
T

Toni

Problem half solved I had this:

java.io.IOException: CreateProcess: dir error=2
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Unknown Source)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at de.sl.cdwriter.CDWriter.main(CDWriter.java:28)

when executing this:

Process p = Runtime.getRuntime().exec("cdrecord -scanbus");

It seems you have to use something like cmd.exe /c before cdrecord
But I am still getting no output, I am getting a message that cdrecord
is either wrongly written or the file is not found.
Can you help now? :)
 
P

Paul Lutus

Toni said:
Problem half solved I had this:

java.io.IOException: CreateProcess: dir error=2
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Unknown Source)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at de.sl.cdwriter.CDWriter.main(CDWriter.java:28)

when executing this:

Process p = Runtime.getRuntime().exec("cdrecord -scanbus");

It seems you have to use something like cmd.exe /c before cdrecord

No, but you do have to provide the full path to the executable. The exec()
call doesn't have access to your path search algorithm, therefore you have
to be very explicit.
But I am still getting no output, I am getting a message that cdrecord
is either wrongly written or the file is not found.

You got what message, from what source, and the words were exactly what?
Copy the exact error message into your newsreader.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top