🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.os2.programmer
1 messages
1 total messages Started by Lewis Perin Sat, 25 Jul 1992 19:57
Re: fopen(f,"r") vs fopen(f,"rb") what's the diff?
#469
Author: Lewis Perin
Date: Sat, 25 Jul 1992 19:57
22 lines
1178 bytes
In article <1992Jul25.175848.29166@unixg.ubc.ca> ochealth@unixg.ubc.ca (ochealth) writes:

   A number of UNIX programs I have ported to OS/2 using emx or gcc
   choke on binary files, unless I modify them.

   for example:
   f = fopen(name,"r") must be changed to f=fopen(name,"rb")
   etc.

   I was wondering just what happens when you don't open as binary.
   Will it return EOF when it sees ^Z or what?

That's been my experience; I'm in the middle of porting a giant UNIX app.

   This is sort of troubling to me, since EMX is desing to make
   porting UNIX easier  Was fopen changed to make it more compatible
   with OS/2 or what. From what I've read "r" and "rb" are handled the
   same in UNIX.

The way I read K&R's 2nd edition, emx is correct.

Cheers, Lew
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads