delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/02/15/11:25:19

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 10:59:10 -0500
Message-Id: <200102151559.KAA31161@envy.delorie.com>
X-Authentication-Warning: envy.delorie.com: dj set sender to dj AT envy DOT delorie DOT com using -f
From: DJ Delorie <dj AT delorie DOT com>
To: delvare AT ensicaen DOT ismra DOT fr
CC: lhall AT rfk DOT com, cygwin AT sources DOT redhat DOT com
In-reply-to:
<Pine DOT SO4 DOT 4 DOT 05 DOT 10102151515430 DOT 1255-100000 AT e3000 DOT ensicaen DOT ismra DOT fr>
(message from Jean Delvare on Thu, 15 Feb 2001 15:36:59 +0100 (MET))
Subject: Re: file descriptors opened as text files
References: <Pine DOT SO4 DOT 4 DOT 05 DOT 10102151515430 DOT 1255-100000 AT e3000 DOT ensicaen DOT ismra DOT fr>

> Yes, b is fine when opening a file *handle* with fopen(). But I am working
> with a file *descriptor* returned by open(), which is quite different.
> open()'s behavior is ruled by a bunch of O flags such as O_RDONLY, 

The best way to make this portable is to do this:

#include <fcntl.h>
#ifndef O_BINARY
#define O_BINARY 0
#endif

Now you can use O_BINARY everywhere, and it will always do the right
thing.  Same for O_TEXT if you need it.

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