Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.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@envy.delorie.com using -f
From: DJ Delorie <dj@delorie.com>
To: delvare@ensicaen.ismra.fr
CC: lhall@rfk.com, cygwin@sources.redhat.com
In-reply-to: 
	<Pine.SO4.4.05.10102151515430.1255-100000@e3000.ensicaen.ismra.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.SO4.4.05.10102151515430.1255-100000@e3000.ensicaen.ismra.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

