delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/01/15/15:18:37

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
Message-ID: <3A635BE9.3A0EF4F8@veritas.com>
Date: Mon, 15 Jan 2001 12:22:01 -0800
From: Bob McGowan <rmcgowan AT veritas DOT com>
Organization: VERITAS Software
X-Mailer: Mozilla 4.73 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: cygwin AT sources DOT redhat DOT com
Subject: Re: Problem with F:/ and /cygdrive/f/ solved!
References: <000501c07f27$8a783640$2397a281 AT marisa DOT space DOT swri DOT edu>

Joey Mukherjee wrote:
> 
....
> However, is O_BINARY a standard flag for open?  Adding that flag on Solaris
> seems to fail in compile since that symbol is not defined or mentioned in
> the open man page.  I'd hate to add #ifdef around every open...
>

I thought it was "standard", but a search of the man pages and include files on a Solaris system failed to find "O_BINARY" and a web search of Linux man pages also failed
to find O_BINARY mentioned on the open() page.  So you may have to define it for environments you know don't have it.

> Why is text mode the default for open?  Wouldn't one use fopen for text
> processing and open for binary?

C on DOS/Windows was made to look as much like UNIX as possible (baring the text/binary mode issue).  On UNIX, fopen() is a function that provides more "efficient" disk
processing by doing reads/writes in chunks and parceling out/collecting the data from/to buffers in user space.  It uses the open() system call to do all the actual I/O.

As to why text mode is the default, I believe (this is suppostion only!) that the assumption was made that user level applications would normally be working with text so it
should be the "usual" mode.

-- 
Bob McGowan
Staff Software Quality Engineer
VERITAS Software
rmcgowan AT veritas DOT com

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