Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

process management

 
niall murphy
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm running a script on UNIX from my java application using

Process p = Runtime.getRuntime().exec("/bin/sh " + cmdfilename);
p.waitFor();

However it doesn't always run successfully so I want to be able to trace
an output /errors thrown from the process ... how should I go about that ?

On a separate note ... the script I'm running is to perform batch ftp operations. Does anyone know of any good java ftp resources/libraries or other ftp script resources ??

Thanks,
Niall.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
niall niall,

Welcome to JavaRanch!

We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.

Is your name really "niall niall"?

Thanks Pardner! Hope to see you 'round the Ranch!
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
google for 'javaworld pitfall runtime' - there is an excellent and detailed article.
 
niall murphy
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

that business with the 'niall niall' name was unintenional !
thanks for the link to the javaworld article

N.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic