On Thu, 26 Aug 1999, Rajesh Kumar wrote:

> Hi List,
>     I would like to get the boolean value by executing  a unix command
> (ie. ls -ld servlets)
>    on a solaris machine through a servlet.
>    SAY :
>     If "servlets" directory exists then the boolean value is TRUE,
> otherwise FALSE.
>
>     Executing a unix command through servlets is OK.  But how can I get
> the boolean result by
>     just executing a unix command?
>     Any suggestions/code snippet?

My first suggestion is that you should ask this on a more appropriate
list.  My second is that you should use the java.io.File class, since
it can do everything you indicate above.  My third one is that you
should check out the java.lang.Runtime class (particularly the exec
method) and the java.lang.Process class (particularly the exitValue
method).

You probably could've found this answer in ten minutes searching of
the comp.lang.java.* newsgroups at Dejanews.

Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to