This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Support for textmode files [WAS: Re: 1.1.8 bug with TCSH 6.10 ( using shell built-in commands )]


Mad Dave wrote:
> 
> I'm sorry but you seemed to misunderstood my last question.  I am quite
> aware of what textmode is, but the release notes for tcsh 6.10 state that
> textmode files are supported, but this isn't always the case, as I have
> found with sourcing a textmode file (my original problem).  The point of the
> question was to assertain when exactly they are supported with the tcsh
> shell and when they are not.
> 
> Would I be right in saying that by supporting textmode files you mean that
> the \r will be stripped off when the file is read by the tcsh, so you wont
> be subjected to seeing ^M all over the place, but due to this foreach, while
> loops, etc will fail with textmode files due to the fact they perform a seek
> type operation based on the bytes read ?  Is this right ?  If so will
> support ever be added for using textmode files as shell scripts ? ( IE use
> another method which takes into account the \r\n translation when performing
> the seek )
> 

Use the source, Luke. (tm)  I'm sure the porter (Corinna, in this case)
had every intention to do so.  She'll also gladly accept a patch to make
it work as you say.  Note, that seek functions used with fd's in
textmode won't work as you think they do.  The read function returns a
count of 1 less that actually read if it strips the \r from the line and
thus you can't keep track of where you are in the file.  The best plan
is to convert the \r to \0 when it is the last character in the line
after the read.  See the bash source for examples of this.

Earnie.

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]