delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/02/14/22:42:35

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: Wed, 14 Feb 2001 22:29:00 -0500
From: Christopher Faylor <cgf AT redhat DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: file descriptors opened as text files
Message-ID: <20010214222900.D25745@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <5 DOT 0 DOT 2 DOT 1 DOT 0 DOT 20010214171434 DOT 00a8f6f0 AT pop DOT ma DOT ultranet DOT com> <5 DOT 0 DOT 2 DOT 1 DOT 0 DOT 20010214175309 DOT 00a92220 AT pop DOT ma DOT ultranet DOT com> <3A8B284F DOT 8071591E AT ihug DOT co DOT nz>
Mime-Version: 1.0
User-Agent: Mutt/1.3.11i
In-Reply-To: <3A8B284F.8071591E@ihug.co.nz>; from ross.s@ihug.co.nz on Thu, Feb 15, 2001 at 01:52:31PM +1300

On Thu, Feb 15, 2001 at 01:52:31PM +1300, Ross Smith wrote:
>"Larry Hall (RFK Partners Inc)" wrote:
>> 
>> At 05:43 PM 2/14/01, Jean Delvare wrote:
>> 
>> >That may explain why I could not see the flag on linux's man pages. But
>> >there is no man page for open(2) on Cygwin, right ? Then, where am I
>> >supposed to find the value for this flag, if it ever exist ? I can't just
>> >invent it, I guess it won't work ;)
>> 
>> "b" is fine, as you indicated before.  Check the MSDN library at
>> msdn.microsoft.com for one source.  I'm sure you can find this information
>> in any POSIX complaint UNIX API reference.
>
>Possibly not. I don't have a copy of the relevant Posix standard, but
>the Single Unix Standard (which I believe is intended to be a superset
>of Posix) doesn't recognise the binary/text mode distinction.
>
>However, the C standard mandates that fopen() uses text mode by default
>in the absence of the "b" flag, and the C++ standard says the same thing
>about iostreams. So, given that the two higher-level I/O APIs are both
>required to default to text mode, it seems perfectly reasonable to me
>for the lowest-level one, open(), to do the same thing in the absence of
>any standard requirements, and it looks as though the Cygwin designers
>have followed the same reasoning.

I suspect that the main reason for implementing things this way was that
"It works that way with MSVC".  I don't know that anyone really knows
the real reason for this, though.  Maybe it was just a horrible mistake
that has been propagated since the projects inception in 1995.

cgf

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