Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Wed, 4 Sep 2002 23:26:02 -0400
From: Christopher Faylor <cgf@redhat.com>
To: cygwin@cygwin.com
Subject: Re: Proposal for new cygwin flag: notextmode masks away O_TEXT
Message-ID: <20020905032602.GC10427@redhat.com>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <20020904110128.B1213@cygbert.vinschen.de> <CHEDKHJJDLOCCOFLMGEACEJGCLAA.dvasaru@broadpark.no>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <CHEDKHJJDLOCCOFLMGEACEJGCLAA.dvasaru@broadpark.no>
User-Agent: Mutt/1.3.23.1i

On Wed, Sep 04, 2002 at 11:57:15PM +0200, Dan Vasaru wrote:
>My apologies if this has already been discussed:
>
>I would just love a CYGWIN variable setting that would make cygwin ignore
>the O_TEXT flag from all programs, thus bypassing any translation code in
>cygwin1.dll.
>May I suggest "notextmode", if not taken already :)
>
>At work, we're aiming for maximum UNIX compatibility between all files
>across win32/linux/solaris. All this O_TEXT stuff really, really gets in the
>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.

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

>We'd rather patch/wrap all non-cygwin utilities in our tool chain (i.e.
>cl.exe) to output binmode only. Thinking of it, one could add an lf-ize
>utility that invokes a program and adds CR to input while removing them from
>output. This would keep the pipes clear of carriage returns.

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.

>lfize cl.exe | grep -v "^$"
>lfize cat textfile | sed | awk
>
>I freely admit not offering much thought to CTRL+Z.

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.

cgf

--
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/

