Re: Mac text files and gets()

new topic     » topic index » view thread      » older message » newer message

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

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu