Re: Mac text files and gets()
- Posted by Derek Parnell <ddparnell at bi?pon?.com> Sep 14, 2007
- 529 views
Bernie Ryan wrote: > > Derek Parnell wrote: > > > > I think that if a text file, being read in any environment, is found to > > contain > > a carriage-return in isolation, it is a reasonable assumption that it is > > intended > > by the file's creator that it represents the end of a text line. Under what > > circumstances would a '\r' by itself, in a text file, literally only means > > "move > > the cursor to the begining of the current display line" (which is what > > carriage > > return means). > > Derek: > > What if you had a text file for a printer that had CR, Vt, FF, etc. > > embedded in it. Then what would happen ? > When one has a file *for a printer*, text or otherwise, one opens it in binary mode and passes each byte of the file to the printer. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell