Article View: comp.os.os2.programmer
Article #468fopen(f,"r") vs fopen(f,"rb") what's the diff?
From: ochealth
Date: Sat, 25 Jul 1992 17:58
Date: Sat, 25 Jul 1992 17:58
25 lines
1362 bytes
1362 bytes
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?
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.
jpm
--
______________________________________________________________________________
jpm: ochealth@unixg.ubc.ca
Happily using OS/2 2.0 because MS Windows isN'T ___
Insert VapourFeature ^^^
Technical Details
Message-ID:
<1992Jul25.175848.29166@unixg.ubc.ca>Path:
arc1-ca.pugleaf.net!sparky!uunet!wupost!gumby!destroyer!ubc-cs!unixg.ubc.ca!ochealthReferences:
<=!jmdvp.feustel@netcom.com> <92Jul25.163359.18069@acs.ucalgary.ca>Show Full Headers
Complete Article Headers
Newsgroups: comp.os.os2.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!gumby!destroyer!ubc-cs!unixg.ubc.ca!ochealth From: ochealth@unixg.ubc.ca (ochealth) Subject: fopen(f,"r") vs fopen(f,"rb") what's the diff? Message-ID: <1992Jul25.175848.29166@unixg.ubc.ca> Sender: news@unixg.ubc.ca (Usenet News Maintenance) Nntp-Posting-Host: unixg.ubc.ca Organization: University of British Columbia, Vancouver, B.C., Canada References: <=!jmdvp.feustel@netcom.com> <92Jul25.163359.18069@acs.ucalgary.ca> Date: Sat, 25 Jul 1992 17:58:48 GMT Lines: 25