Home Web Design Programming Fairlight CMI Soap Box Downloads Links Biography About... Site Map

The Holmes Page THE SOAP BOX 1997/07/02

 



BACK TO
SOAP BOX

1997/07/02: Text File Line Endings   The Web is the great equalizer. In some ways it has saved Unix from extinction, while also boosting the popularity of Windows and the Mac. 
What bugs me, though, is Unix-style text files. They always have. Each line of text ends only in a line-feed character, instead of carriage-return and line-feed as in the PC world. 
Think about it. What does the line-feed character mean? It means move down one line at the current column position. (Actually, in the original teletype meaning, it means move the paper up one line.) So when you print out one of those Unix text files, you end up with something like this:
    Now is the time
                   for all good men
                                   to come to the aid
                                                     of the people.

Conversely, what does the carriage-return character mean? It means move back to the left-most column while remaining on the same line. If you print out a file that uses only carriage-returns as line terminators, you get a bunch of lines printing on top of each other, all on the same line. 
The PC convention of using a carriage-return and a line-feed is the right one, even if it makes the file size larger by one more character per line. 
Strangely, the Netscape bookmark file contains lines that terminate in 2 carriage-returns and a line-feed. 
Suspenders and a belt, I guess.

Previous: 1997/06/18 - Movie Web Sites
Next: 1997/07/16 - No News Is Good News


Home Web Design Programming Fairlight CMI Soap Box Downloads Links Biography About... Site Map

Site Map Send comments about this site to Greg at gregh@ghservices.com
All pages copyright © 1996-1999 GH Services™   Created 1997/07/02   Last updated 1999/09/30
All trademarks contained herein are the property of their respective owners