Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > exec with stdin stdout

Reply
Thread Tools

exec with stdin stdout

 
 
Paul Gessos
Guest
Posts: n/a
 
      09-06-2005
Why this code not working?


byte[] buf = new byte[10000];
Process p = Runtime.getRuntime().exec("php -n 1.php");
p.getErrorStream().close();
InputStream is = p.getInputStream();
OutputStream os = p.getOutputStream();
os.write("write serialized data...".getBytes());// never takes data
p.waitFor();
int count = is.read(buf); // count == -1
System.out.println(buf); // write garbage
System.exit(0);
 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      09-06-2005
On Tue, 06 Sep 2005 19:27:52 +0300, Paul Gessos wrote:

> Why this code not working?


Maybe it is lazy. Did you try flogging it?

--
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
"If we fall, others are rising.."
Paul Kelly 'From Little Things, Big Things Grow'
 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      09-06-2005
>>Why this code not working?
>
> Maybe it is lazy. Did you try flogging it?


I respect personality of my programs. You are a Nazi scum!


Have you a better answer?
 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      09-06-2005
On Tue, 06 Sep 2005 20:10:29 +0300, <- Chameleon -> wrote:

>>>Why this code not working?

>>
>> Maybe it is lazy. Did you try flogging it?

>
> I respect personality of my programs. You are a Nazi scum!
>
>
> Have you a better answer?


Better than 'You are a Nazi scum!'?

...try my answer on the other (sub) thread.

--
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
"..When after all, it was you and me."
The Rolling Stones 'Sympathy For The Devil'
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
peek at stdin, flush stdin Johnathan Doe C Programming 5 05-17-2013 04:30 PM
How to pass stdin of a C++ program to the stdin of a process createdwith ShellExecute() Ben C Programming 2 08-29-2009 09:47 PM
Runtime.exec on Win98: stdin, stdout with long DOS command line? Bernard Java 4 01-03-2006 02:33 PM
exec with stdin stdout Java 4 09-06-2005 09:54 PM
Reading stdin once confuses second stdin read Charlie Zender C Programming 6 06-21-2004 01:39 PM



Advertisments