On Fri, 21 Mar 2003, Dinesh Abichandani wrote:

> hi there
> I am trying to execute a unix command from servlet. Command woks fine when i
> try to get output on to terminal and this is the code for that:
>
> Process proc=null;
>     Runtime rt = Runtime.getRuntime();
>     proc = rt.exec(new String[] 
> {"/vol1/people/dinesh/htblast/blockhead_64","-stdout","/vol1/people/dinesh/htblast/testfile.fsa","/vol1/people/dinesh/htblast/rules_file","1"});
> but when i try to redirect it to a file it is not working ,,though it works
> when i execute this command from command line in unix shell.here is the code for 
> that:
> Process proc=null;
>     Runtime rt = Runtime.getRuntime();
>     proc = rt.exec(new String[] 
> {"/vol1/people/dinesh/htblast/blockhead_64","-stdout","/vol1/people/dinesh/htblast/testfile.fsa","/vol1/people/dinesh/htblast/rules_file","1",">","test2.out"});
> where test2.out is the file where i want my output.
> i have tried giving the absolute path of test2.out but command didnt write to it.

Sounds like it could be a permissions issue.  Remember, when you run
something from your shell, you are running it as yourself.  When it
runs within a servlet, it is running as whatever user the servlet
container is set up as.  And that use may not have the same
permissions.

Milt Epstein
Research Programmer
Integration and Software Engineering (ISE)
Campus Information Technologies and Educational Services (CITES)
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