autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More on fopen() problem on Cygwin


From: Earnie Boyd
Subject: Re: More on fopen() problem on Cygwin
Date: Wed, 22 Nov 2000 11:13:15 -0800 (PST)

--- "Lars J. Aas" <address@hidden> wrote:
> Even after setting /cygdrive to binary mode, the problem with
> fopen(file, "w") persists (since I had fixed my own autoconf
> repository to use "wb" I didn't notice it until I tried to configure
> glib which has it's own set of macros like that.
> 
> I suspect that it is related to the fact that I'm using VC++'s
> cl.exe instead of gcc, so another C library is used.  Does that
> make sense?
> 

Yes.  Non-Cygwin aware programs could still produce \r\n output.  However,
package maintainers are trying to make the text vs binary hell more tolerable
by forcing text mode reads for known text files so that the \r doesn't get in
the way when read from binary mounts.  There have been patches to bash, ash and
other packages to handle the \r\n appropriately.

Hmm...  If you use a program that produces \r\n line endings then "rb" should
cause the problem as you would get the \r trailing the line.  Oh, I get it,
it's cl that's creating the program that outputs the lines that contains the
\r\n.  This means that your "wb" would cause the cl created program to output
only \n line endings and would be read appropriately with Cygwin packages on
binary mounts.

Given that "wb" and "rb" are ANSI compliant then I suggest that your "wb" patch
to be correct.  It solves the problems created by non-Cygwin programs and this
includes all other Win32 ports of GCC.

Cheers,

=====
Earnie Boyd
mailto:address@hidden

---         <http://earniesystems.safeshopper.com>         ---
--- Cygwin: POSIX on Windows <http://gw32.freeyellow.com/> ---
---   Minimalist GNU for Windows <http://www.mingw.org/>   ---

__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]