From: "Roman Mikhailov" <[EMAIL PROTECTED]>
Sent: Wednesday, July 24, 2002 11:34 AM
Subject: Unix command from jsp does not work


> I'm trying to execute a unix command from within the jsp page, smth like
>
> Process p = Runtime.getRuntime().exec(new String[]{"/bin/sh","-c","ls -l >
> dat.foo"});
>
> .. And it doesn't work, I mean nothing happens , no error messages,
nothing

Well, if the ls -l happens to not find the file foo.dat, then it's proper
result would be to, essentially, "do nothing". So, perhaps it actually is
working, and the file you're running 'ls' on isn't there?

P.S. just an FYI, but you do realize that the java.io.File object does
pretty much what 'ls' will do for you, right? Plus, it's portable...

Regards,

Will Hartung
([EMAIL PROTECTED])




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to