home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / os2 / programm / 3774 < prev    next >
Encoding:
Internet Message Format  |  1992-07-25  |  1.1 KB

  1. Path: sparky!uunet!stanford.edu!rutgers!cmcl2!JED.CS.NYU.EDU!m-lp9966
  2. From: m-lp9966@JED.CS.NYU.EDU (Lewis Perin)
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: Re: fopen(f,"r") vs fopen(f,"rb") what's the diff?
  5. Message-ID: <9207251957.AA12652@jed.cs.nyu.edu>
  6. Date: 25 Jul 92 19:57:26 GMT
  7. Sender: daemon@cmcl2.nyu.edu (Mr Background)
  8. Organization: New York University
  9. Lines: 22
  10.  
  11. In article <1992Jul25.175848.29166@unixg.ubc.ca> ochealth@unixg.ubc.ca (ochealth) writes:
  12.  
  13.    A number of UNIX programs I have ported to OS/2 using emx or gcc
  14.    choke on binary files, unless I modify them.
  15.  
  16.    for example:
  17.    f = fopen(name,"r") must be changed to f=fopen(name,"rb")
  18.    etc.
  19.  
  20.    I was wondering just what happens when you don't open as binary.
  21.    Will it return EOF when it sees ^Z or what?
  22.  
  23. That's been my experience; I'm in the middle of porting a giant UNIX app.
  24.  
  25.    This is sort of troubling to me, since EMX is desing to make
  26.    porting UNIX easier  Was fopen changed to make it more compatible
  27.    with OS/2 or what. From what I've read "r" and "rb" are handled the
  28.    same in UNIX.
  29.  
  30. The way I read K&R's 2nd edition, emx is correct.
  31.  
  32. Cheers, Lew
  33.