View the Most Wanted LQ Wiki articles.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 07-16-2004, 06:00 PM   #1
Registered: Feb 2003
Location: Hawaii
Distribution: Debian
Posts: 130

Rep: Reputation: 16
Unhappy Problem executing this piped command: JAVA

I want to execute the following command from a java application. As you can see, I want to back up the BACKUP directory (which is located on the user home directory) to a CD without creating an ISO image.

From the shell it works like a charm.

mkisofs  -R  /home/jennifer/BACKUP  | cdrecord -v fs=6m speed=2 dev=0,0,0 -

But obviously my java implementation of that command doesn't work...any inputs are welcome. If you can tweak around my code to see your idea that would be wonderful. Thanks.

try {

 String cmdBurn = "mkisofs -R " + System.getProperty ( "user.home" ) +
                           "/" + "BACKUP " + "| " +
                                   "cdrecord -v fs=6m speed=4 dev=0,0,0 -" ;

  Process listBurn = Runtime.getRuntime ().exec ( cmdBurn ) ;
   catch ( IOException ex ) {

Last edited by randomx; 07-16-2004 at 06:08 PM.
Old 07-16-2004, 08:39 PM   #2
Registered: Apr 2004
Location: Oxford, UK
Distribution: Ubuntu, Debian, various
Posts: 230
Blog Entries: 5

Rep: Reputation: 33
I don't know for sure, but at a guess I think you need to invoke a shell to get the pipeline functionality. Try making your command:

sh -c "mkisofs -R /home/jennifer/BACKUP | cdrecord -v fs=6m speed=2 dev=0,0,0 -"



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
java code executing SQL statements problem randomx Programming 1 11-09-2004 11:59 AM
Problem executing java programs nro Programming 2 08-28-2004 02:09 AM
Problem executing from command line jleyba213 Linux - General 4 04-09-2004 01:43 PM
How to redirect standard output of piped command to log file andrewstr Linux - General 10 02-04-2004 03:07 PM
Newbie question about executing java command oldoldcat Linux - General 4 01-30-2004 02:15 AM

All times are GMT -5. The time now is 09:31 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration