On Mon, 10 May 1999, david shen wrote:

> Hi, guys

You could redirect the output of the Java (and therefore the Jacl)
process using the java.lang.System class. The methods are called
setIn(InputStream) and setOut(PrintStream). You code would look
something like this.

FileOutputStream fos = new FileOutputStream("file");
PrintStream ps = new PrintStream(fos);

System.setOut(ps);
Interp interp = new Interp();
interp.evalFile("file.tcl");
...

later
mo

 
> I would like to complete the following using both java and jacl.
> 
> 1) run a tcl file
> 2) direct the output to a file
> 3) analyze the file
> 
> My only poor solution is the following
> 1)
>    class ExecCommand() {
>    main() {
>     Interp interp;
>     interp = new Interp();
>     interp.evalFile("hello.tcl");
>     interp.dispose();
>    }
>    }
> 2)
>     %java ExecCommand > a.output
> 
> 3)
>     %java AnalyzeFile a.output
> 
> 
> I really don't want to use either DOS command ">" or Unix command ">"
> Is there a better alternative?
> 
> I was hoping that evalFile can have a return type = File.
> 
> thanks
> 
> david
> 
> 
> _______________________________________________________________
> Get Free Email and Do More On The Web. Visit http://www.msn.com
> 
> ----------------------------------------------------------------
> The TclJava mailing list is sponsored by WebNet Technologies.
> To subscribe:    send mail to [EMAIL PROTECTED]  
>                  with the word SUBSCRIBE as the subject.
> To unsubscribe:  send mail to [EMAIL PROTECTED] 
>                  with the word UNSUBSCRIBE as the subject.
> To send to the list, send email to '[EMAIL PROTECTED]'. 
> A list archive is at: http://www.findmail.com/listsaver/tcldallas/
> 

----------------------------------------------------------------
The TclJava mailing list is sponsored by WebNet Technologies.
To subscribe:    send mail to [EMAIL PROTECTED]  
                 with the word SUBSCRIBE as the subject.
To unsubscribe:  send mail to [EMAIL PROTECTED] 
                 with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'. 
A list archive is at: http://www.findmail.com/listsaver/tcldallas/

Reply via email to