Subject: Re: putc bug ?
From: [email-masked]

23 Jun 1998 20:05:25 -0700
Message-ID: <[email-masked]>
To: [email-masked], [email-masked], [email-masked]

> It's the old text vs. binary file processing mode.  Under UNIX the
> default mode is binary, under WIN32 the default mode is text.

Yep, but under Unix there really isn't a text/binary mode, since the
representations are the same.  It's only on WIN32 that there are distinct
text and binary modes.  Thus, Unix programs can be sloppy about specifying
the type of file, since the Unix libraries ignore the specification anyhow.
 
> Work-around:
> 
> Specify the binary mode switch on the file open functions, append a
> "b" to "r" or "w" for fopen and use _O_BINARY (defined in fcntl.h) for
> the open function.

That's not really a "work-around", as that is actually how ANSI C says
that a properly written program should be written.

But, certainly that is correct advise.

marcus hall
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".