LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 07-16-2004, 05:00 PM   #1
randomx
Member
 
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.

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

Code:
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 05:08 PM.
 
Old 07-16-2004, 07:39 PM   #2
avarus
Member
 
Registered: Apr 2004
Location: Oxford, UK
Distribution: Ubuntu, Debian, various
Posts: 230
Blog Entries: 5

Rep: Reputation: 32
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 -"

TIM
 
  


Reply


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 10:59 AM
Problem executing java programs nro Programming 2 08-28-2004 01:09 AM
Problem executing from command line jleyba213 Linux - General 4 04-09-2004 12:43 PM
How to redirect standard output of piped command to log file andrewstr Linux - General 10 02-04-2004 02:07 PM
Newbie question about executing java command oldoldcat Linux - General 4 01-30-2004 01:15 AM


All times are GMT -5. The time now is 12:05 PM.

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