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: Wed, 14 Feb 2001 23:08:52 +0100 (MET)
From: Jean Delvare <delvare@ensicaen.ismra.fr>
To: "Larry Hall (RFK Partners Inc)" <lhall@rfk.com>
Cc: cygwin@sources.redhat.com
Subject: Re: file descriptors opened as text files
In-Reply-To: <5.0.2.1.0.20010214165225.00a95e40@pop.ma.ultranet.com>
Message-ID: <Pine.SO4.4.05.10102142259240.22033-100000@e3000.ensicaen.ismra.fr>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII



> Type "mount" on your system.  What does it show?  Is the file in question
> being written under any of these mount points?  Any of them binary?
I think I understand the mount mechanism, and the binary vs text mode
mount. But I don't see the point when runing out of bash. Do you pretend
that the way I mount my drives with bash/mount changes the program
behaviour when I run it directly from Windows ? (I can hardly believe it)

> Bingo.  Cygwin treats files as text by default, unless you specify a 
> different default.  If you want your program to treat the file as binary,
> add the appropriate flags on the appropriate calls.  Whamo!  Your problem
> is solved.
I hope so. That's also the way I see the thing. The question is : What
flags ?
When using handles, I can solve the problem with fopen(f,"rb") instead of
fopen(f,"r"). And it works. But I read the whole read(2) man page (on
Linux, it doesn't exist on Cygwin) and nowhere I saw a flag that force
binary mode. Can you help ?

Anyway, thanks *a lot* for the help so far.

-- 
       /~~       Jean "Khali" Delvare
  -----\_                        mail: delvare@ensicaen.ismra.fr
 --------\                http://www.ensicaen.ismra.fr/~delvare/
---=ISMRA/- ____________________________________________________


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

