At 11:19 31/05/2002 -0700, H. Peter Anvin wrote:
>Unix actually uses LF as line separator, not CR.
Oh well, I knew it was only one character, just forgot which :) I've yet to
decide which format I'm going to use for newlines in my OS, but I guess
I'll probably try to support all 3 possibilities for reading (I just have
to figure which may be most useful for writing).
>The thing is, most Unix programs see CR as a *character* (usually a
>whitespace character.) For example, if you're using a \ line
>continuation, it will break if it has a CR after it.
I didn't know that. It will definitely affect how I write code. It's not a
major hassle anyway (at least for me it's not), as there are enough
Unix2DOS and DOS2Unix translators out there, and if there weren't, it would
be simple to write one :)
>Unix simply doesn't have the concept of "text" versus "binary" files (DOS
>doesn't really either, but C libraries are forced to deal with the
>difference because of the composite line ending and the different EOF
>MacOS -- at least MacOS 9.x and earlier -- use CR alone, to really make
Hmm - I'll have to see what Windoze does when it opens a text file which
uses the MAC style...
>CVS knows how to deal with different line endings.
Yeah, I'd worked that out, I just don't always remember what happens with
editors on different platforms :)
> For a genuine binary file, you should check it in with "cvs add -kb",
> otherwise CVS will convert the line endings to and from whatever is
> appropriate for text files on your system. What really becomes a problem
> is if CR or LF characters get checked into CVS *as anything other than a
> line ending*. This can happen, for example, if you check out a file on a
> Windows system, move it over to a Unix system, and check it in -- you
> just added a CR character to every line, that isn't part of the line ending.
Fortunately, I don't expect to need to upload a binary file to CVS (at not
in the close future, the future could hold anything...).
If you try and don't succeed, cheat. Repeat until caught. Then lie.
I report spam, any unsolicited emails on unrelated topics will be reported.