Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Executing cdrtools commands from java.

12 views
Skip to first unread message

Toni

unread,
Oct 5, 2004, 11:29:11 AM10/5/04
to
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.

Paul Lutus

unread,
Oct 5, 2004, 1:05:13 PM10/5/04
to
Toni wrote:

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

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

--
Paul Lutus
http://www.arachnoid.com

Toni

unread,
Oct 6, 2004, 3:39:50 AM10/6/04
to
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.

Michael Borgwardt

unread,
Oct 6, 2004, 3:55:00 AM10/6/04
to
Toni wrote:

> 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.

Paul Lutus

unread,
Oct 6, 2004, 4:11:35 AM10/6/04
to
Toni wrote:

> 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.

Andrew Thompson

unread,
Oct 6, 2004, 5:25:53 AM10/6/04
to
On 6 Oct 2004 00:39:50 -0700, Toni wrote:

> 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.

<http://www.physci.org/codes/javafaq.jsp#exact>

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane

Toni

unread,
Oct 7, 2004, 3:49:57 AM10/7/04
to
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? :)

Paul Lutus

unread,
Oct 7, 2004, 3:54:36 AM10/7/04
to
Toni wrote:

> 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.

Toni

unread,
Oct 8, 2004, 3:53:12 AM10/8/04
to
Thank you guys for your clarifications it is working now.
0 new messages