delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/02/15/10:50:16

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Thu, 15 Feb 2001 16:46:46 +0100
From: Corinna Vinschen <cygwin AT cygwin DOT com>
To: cygwin <cygwin AT cygwin DOT com>
Subject: Re: Support for textmode files [WAS: Re: 1.1.8 bug with TCSH 6.10 ( using shell built-in commands )]
Message-ID: <20010215164646.H13799@cygbert.vinschen.de>
Mail-Followup-To: cygwin <cygwin AT cygwin DOT com>
References: <81E198609B9DD311BE0A00508B5E2984F91F2C AT ipsent02 DOT camelot DOT seagatesoftware DOT com> <3A8ACEF0 DOT 1F3F2AD0 AT yahoo DOT com> <004101c09704$81def5b0$e682edc1 AT deepsleep> <3A8BE60B DOT 697ECF5D AT yahoo DOT com>
Mime-Version: 1.0
User-Agent: Mutt/1.2.5i
In-Reply-To: <3A8BE60B.697ECF5D@yahoo.com>; from earnie_boyd@yahoo.com on Thu, Feb 15, 2001 at 09:22:03AM -0500

On Thu, Feb 15, 2001 at 09:22:03AM -0500, Earnie Boyd wrote:
> 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

Actually using textmode for shell scripts should work. Except for one
lseek in the source all are seeking to position 0 which is not critical.

I will take a look into the sources if I missed something but it's not
too high on my priority list though I'm using tcsh all the time.

I would appreciate a hint or better a patch as you wrote.

> 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

Using lseek or fseek in textmode should work, actually. There's one
problem: When opening a file pointer using fopen() a later call to
setmode(fileno(fp),...) has no meaning for the file pointer operations.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019