Ah yes, the old \r\n hack rears its ugly head again. The main problem
here is that the "fix" in Jacl 1.1 was really just an ugly hack that
gave the false impression that things were working correctly. The
real problem here is that the Jacl "channel" drivers do not take
\r\n into account. To really fix this problem the channel drivers
will need to be rewritten to convert line endings based on the
channel setting. The catch here is that to really "fix" the problem
unix (\n), windows (\r\n), and mac (\r) would need to be supported.
There is also the problem that fconfigure is not implemented in Jacl.

So you have a couple of options:

1) you could just convert the file endings on your files to \n.
I could give you a simple Tcl script that does this.

2) you could add add the \r\n hack from 1.1 back into your code.
This is kind of ugly but it would seem to "solve" your problem.
The \r\n hack is not going to be added to the main 1.2 tree.

3) you could donate some of your time to the Jacl project
and work on the "right" fix (fixing the channel drivers).
I have some example code that could get you started.


later
Mo DeJong


On Fri, 5 Nov 1999, Trella Christopher-P28453 wrote:

> I am sourcing a script that has the following lines in it.  Whenever I
> source it, it gives an error.  I am 
> using Jacl 1.2.5.  This used to work in Jacl 1.1.1.
...
> I did some investigation into the Interp.readScriptFromFile method.  In Jacl
> 1.1.1, readScriptFromFile
> called translateLineSeparators to translate a \r\n pair for a windows
> newline to \n for the interpreter (My script
> was written on a PC so it has \r\n in it).  In Jacl 1.2.5, the
> translateLineSeparators method is not present,
> but needs to be for the script to run correctly.  
>  
>  
> Chris Trella
> 480-675-1347
> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 
>  

----------------------------------------------------------------
The TclJava mailing list is sponsored by Scriptics Corporation.
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]'. 

Reply via email to