[282] in java-interest
another exec/join question
daemon@ATHENA.MIT.EDU (David Gourley)
Mon Jun 12 14:43:44 1995
To: java-interest@java.sun.com
Cc: dgourley@csua.berkeley.edu
Date: Mon, 12 Jun 1995 11:26:00 -0700
From: David Gourley <dgourley@csua.berkeley.edu>
Hello again,
>Have you tried using System.execin()? It returns an InputStream that
>you can read from. I suspect that the InputStream will be closed when
>the process terminates. What really should happen is that System.exec
>returns a Process object represention the external process. It could
>have methods for getting its status. Maybe we can introduce this in
>the beta release?
I am using execin currently, but I am not sure how to tell if the stream
has been closed. I need the result stream from the command so I do look
at it. Is there anyway to tell if a stream has been closed by the external
process? I may be overlooking something, but I am not sure how to get
around this problem.
I think that if possible you should incorporate a Process object into the
beta release, if that is not possible perhaps a way to at least fetch the
exit status of the executed process. I have run into other problems where
it would be nice to know if the external processed exited normally or
abnormally. Seems that this could be part of the exec method, which
currently returns void. If it returned int, one could at least execute
processes and know if they were sucessful.
>Arthur van Hoff (avh@eng.sun.com)
Thanks for you help,
-David Gourley
dgourley@now.cs.berkeley.edu
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com