🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #10390

Re: fopen() modes in Lattice C

#10390
From: Miles Bader
Date: Sun, 27 Nov 1988 16:40
20 lines
1264 bytes
jdp@killer.DALLAS.TX.US (Jim Pritchett) writes:
> Could/would someone out there please tell me what the addition of a 'b' paramet\
> er
> to the mode means in the context of a fopen() call in Lattice C?  I have Aztec
> C and it does not mention this at all.  Neither does my K&R - unless I missed
> it somehow.

On the amiga, these modes are exactly the same as the default modes
(without the 'b').

With some operating systems, like msdos, the default modes translate
between CR/LF newlines (which the os uses) and LF newlines (which c
programs use), and you need the 'b' modes to turn off this
translation.  But since the amiga os uses LF as newline, there's no
need to ever do a translation in the amiga version.

So they're there just to be compatible with other releases of the
compiler.

-Miles
Technical Details
Message-ID: <8XY30Cy00UkaM=Ab9Q@andrew.cmu.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!rochester!pt.cs.cmu.edu!andrew.cmu.edu!bader+
References: <6241@killer.DALLAS.TX.US>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!rochester!pt.cs.cmu.edu!andrew.cmu.edu!bader+
From: bader+@andrew.cmu.edu (Miles Bader)
Newsgroups: comp.sys.amiga.tech
Subject: Re: fopen() modes in Lattice C
Message-ID: <8XY30Cy00UkaM=Ab9Q@andrew.cmu.edu>
Date: 27 Nov 88 16:40:46 GMT
References: <6241@killer.DALLAS.TX.US>
Organization: Carnegie Mellon
Lines: 20
In-Reply-To: <6241@killer.DALLAS.TX.US>