delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/02/14/17:24:51

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 17:21:29 -0500
From: Christopher Faylor <cgf AT redhat DOT com>
To: cygwin AT cygwin DOT com
Cc: delvare AT ensicaen DOT ismra DOT fr
Subject: Re: file descriptors opened as text files
Message-ID: <20010214172129.C19427@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com, delvare AT ensicaen DOT ismra DOT fr
References: <5 DOT 0 DOT 2 DOT 1 DOT 0 DOT 20010214165225 DOT 00a95e40 AT pop DOT ma DOT ultranet DOT com> <Pine DOT SO4 DOT 4 DOT 05 DOT 10102142259240 DOT 22033-100000 AT e3000 DOT ensicaen DOT ismra DOT fr>
Mime-Version: 1.0
User-Agent: Mutt/1.3.11i
In-Reply-To: <Pine.SO4.4.05.10102142259240.22033-100000@e3000.ensicaen.ismra.fr>; from delvare@ensicaen.ismra.fr on Wed, Feb 14, 2001 at 11:08:52PM +0100

On Wed, Feb 14, 2001 at 11:08:52PM +0100, Jean Delvare wrote:
>>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)

I doubt that Larry is pretending.  Mount does, of course, control the
behavior of any cygwin-compiled program.

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

Read the mount documentation.  It's on the cygwin web page.

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