> Pol Millan wrote:
>
> Does anyone know how I can execute an OS command like "dir" from a
> servlet?
Well if you really want a directory listing, you can use
java.io.File.list() , and stay in Java.
If you are just using dir as an example, then you need to look at
Runtime.exec(), which lets you run local executables.
>
> And if it's possible, does it compromise the portability? I guess so.
Yes and no, you cant get 100% Pure Java certification, but you can
get acceptable portability by invoking scripts which mask the os
differences.
By the way, dir is a special case, since there is no dir.exe - it is
a built-in in command.exe , so you have to use a script to invoke it.
I think you will find an example in the O'reilly servlets book,
I strongly advise you to buy it if you plan doing _anything_ with
servlets.
Contact me off-line if you need more help....
T.
>
> Thanks,
>
> Pol Millan
> top-pile.com
> Ibex House
> 162-164 Arthur Road
> Wimbledon Park
> London, SW19 8AQ
> Tel: +44 (0)181 255 6777
> Fax: +44 (0)181 255 6776
> Web: www.top-pile.com (& follow links)
> Email: [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