delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/09/05/17:46:40

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <1031222391.3d7734779dac6@mail.broadpark.no>
Date: Thu, 5 Sep 2002 12:39:51 +0200
From: dvasaru AT broadpark DOT no
To: cygwin AT cygwin DOT com
Subject: Re: Proposal for new cygwin flag: notextmode masks away O_TEXT
References: <20020904110128 DOT B1213 AT cygbert DOT vinschen DOT de> <CHEDKHJJDLOCCOFLMGEACEJGCLAA DOT dvasaru AT broadpark DOT no> <20020905032602 DOT GC10427 AT redhat DOT com>
In-Reply-To: <20020905032602.GC10427@redhat.com>
MIME-Version: 1.0
User-Agent: Internet Messaging Program (IMP) 3.0
X-Originating-IP: 192.18.243.4

Chris,

You're right of course, and I will not push for this very hard, but such a flag would ensure compatible results across platforms:

file.txt:
i have crlf\r\n
and another one\r\n

solaris> sed 's/crlf$/nocr/' file.txt
i have crlf\r\n
and another one\r\n

cygwin> sed 's/crlf$/nocr/' file.txt
i have nocrlf\n
and another one\n

proposed:
cygwin-notextmode> sed 's/crlf$/nocrlf/' file.txt
i have crlf\r\n
and another one\r\n

Read also my comments below.

Quoting Christopher Faylor <cgf AT redhat DOT com>:

> On Wed, Sep 04, 2002 at 11:57:15PM +0200, Dan Vasaru wrote:

> >way. All our mounts are binmode, yet the fact that some programs set the
> >O_TEXT flag, and cygwin doesn't ignore it, will at some point add a stray
> >carriage return (see various threads on CRLF) in various pipes and
> >redirects.
> 
> No, it won't add a stray CR unless the file is opened as O_TEXT for
> output, which no programs in the cygwin release should be doing.  O_TEXT
> for input specifically means that CRLFs are translated to LFs
> internally.

Mea culpa, it turns out the stray CR did happen on a text mount. 

> It will *interpret* a CRLF as a LF, however, which has its own
> ramifcations.

notextmode comes in handy here :).

[...]
> Why would you want to *add* a CR to input?  A program which uses O_TEXT
> for input will still consider lines ending only with LF to be properly
> terminated.

That would be for input to non-cygwin software that demands CR (notably notepad).
 
[...]
> I have a feeling that one of us still isn't getting something here.
> If you are willing to write a program which wraps every DOS program
> which outputs CRLF, then do that, mount everything with -b and you
> should be all set.
 
Point taken, and we shall do this. 

Thanks,
    dan.



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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