The Artima Developer Community
Sponsored Link

Legacy Design Forum
Designing with Runtime Class Information

Advertisement

Advertisement

This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Need a help on the getRuntime() function

Posted by lazyman on January 13, 2002 at 4:24 PM

I have a problem :

Process p=Runtime.getRuntime().exec("pr -l 61 a.txt> b.txt");

After I Run java Program, the file "b.txt" doesn't created.
Does anybody know why? It seems java Runtime doesn't know what is the ">"?

Thanks a lot!


> interesting problem
> did u get the soln
> if so please pass it on
> thanks
> thomas

> > my problem is using the Runtime's exec method i've launched a code like this

> > Process p = Runtime.getRuntime().exec("java test");
> > - in a abc.java program -

> > in that particular 'test.java' which i am launching using the Runtime's exec method, i have written one
> > ----
> > System.out.println("hello world");
> > System.in.read(byteArray);
> > ----
> > I was able to retrieve
> > the 'hello world' string using an inputstream

> > but i was unable to send some string data to that process which is hanging there at system.in.read?

> > How to solve this?





Replies:
  • Runtime Peter Kelley February 08, 2002 at 4:32 PM (0)

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us