Path: utzoo!attcan!uunet!snorkelwacker!mintaka!ogicse!decwrl!shlump.nac.dec.com!mountn.dec.com!minow From: minow@mountn.dec.com (Martin Minow) Newsgroups: comp.sys.mac.programmer Subject: Re: r vs n in Think C 4.0 Message-ID: <1375@mountn.dec.com> Date: 19 Feb 90 15:18:02 GMT References: <1196@batroc.dmc.com> Reply-To: minow@thundr.enet.dec.com (Martin Minow) Organization: Digital Equipment Corporation Lines: 24 >Mike Engber engber@gumball.ils.nwu.edu writes: > >I was experimenting in Think C (4.0) and it seems that the stdio routines >don`t properly distinguish \n and \r. > >I was under the impression that on the Mac, lines were separated by >returns, \r. But whenever I read I get newlines, \n, instead. Similarly, >when I print out \n's, \r`s seem to really get output. > This is required by the Ansi Standard. Stdio must translate between '\n' and whatever the operating system requires ( on the Mac, on generic Unix, on other systems, operating-system magic on line-oriented systems). The idea between stdio is that it isolates your program from having to deal with the underlying mechanisms. If you want to process the actual values in the file, you must either use a non-stdio routine (the Mac's FS... and PB... families) or -- in some cases -- open the file using "binary" mode (this works for files, but might not work for the display or keyboard as you might wish). Martin Minow minow@thundr.enet.dec.com