delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/06/22/18:35:07

From: lmauro AT scientist DOT com (Leo Mauro)
Subject: RE: putc bug ?
22 Jun 1998 18:35:07 -0700 :
Message-ID: <000001bd9ddb$4da1a600$1e6e31cf.cygnus.gnu-win32@leo-nt.rd.telesystech.com>
References: <199806220023 DOT BAA00957 AT Talisker DOT demon DOT co DOT uk>
Mime-Version: 1.0
To: <gnu-win32 AT cygnus DOT com>

On Sunday, June 21, 1998 08:23 PM, John Gumb wrote:

> For amusement, I've been trying to port Intel's I960 tools (CTOOLS)
> to run under Cygnus on 95/NT. I'm almost there...but an oddity in
> putc seems to be causing problems.
[SNIP]
> It looks to me like putc in it's wisdom thinks a <CR> should be
> inserted before what putc interprets as <LF>.
[SNIP]

This is a well known DOS/Win/NT issue.  Please read

http://www.cygnus.com/ml/gnu-win32/1998-Jun/0308.html

in the searchable mailing-list archive for an explanation and
a few solutions.

> Surely it can't be within the ANSI/POSIX rules for putc to be
> doing this ?

It is not putc per se that's doing this.  Even write would do it.
Unless you specify binary mode instead of text mode, as
explained above.

> Interestingly, the above 'problem' happens using Microsoft VC++5.
> Wonder if there's a connection....?

Yes...  They all run under DOS/Win/NT...  By the way, you can
specify binary mode opens under VC++ 5 in the same way as in
CygWin32 (there are no mount points, though).

The ability to specify binary vs. text mode opens has been in
place for some 15 years in all C environments running under
DOS/Win/NT, since the very first ones.

Of course, all this makes no sense under UNIX, where a file
is a file is a file and contains exactly what you put in it.  But
hey!  You're running Windows, where magic and wizards rule
and nothing is what it seems... :-)

Leo

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019