[GRLUG] unix2dos? No... FLIP.

Don Ellis don.ellis at gmail.com
Mon Aug 26 15:44:42 EDT 2013


Yes, it would seem that LF+CR and CR+LF would be equivalent, and
that's what I thought at first.

However, when I tried using LF+CR on an ASR-33 (my first system IO &
bulk storage device), I found that the LF was almost instantaneous,
while the CR requires some time to execute. Sending the CR first
worked as expected, but sending LF first resulted in lines beginning
to print on the retrace; the beginning of the line was printed
backward diagonally from right to left.

Some time later, I worked with a Unix system that required me to write
the lp handlers, so I got to experiment with a system where I could
bypass the SPOOL system (an acronym - look it up). Easiest way to
bypass it, of course, is not to have written it yet. If you send two
files at the same time without SPOOL, the characters from each file
will be intermixed. Try doing that in DOS!

> I'm far from a Windows apologist, but if you fed a text file straight to a line printer without translation...

In most cases, transferring a file from one system to another would
result in translation (going back to late '80s or earlier). Might be
worthwhile to put a filter in the SPOOL system to detect different
line endings and handle them, but it would typically be handled
upstream somewhere, in order to allow looking at the file in the first
place.

--Don Ellis


On Sat, Aug 24, 2013 at 6:17 PM, Matt Behrens <matt at zigg.com> wrote:
> On Aug 24, 2013, at 2:03 PM, Greg Folkert <greg at gregfolkert.net> wrote:
>
>> And Most things in Linux can and do deal with Windows erroneous ways of
>> doing things.
>
> I'm far from a Windows apologist, but if you fed a text file straight to a line printer without translation...
>
> LF (Unix and Unix-like) would give you a stair-stepped printout, e.g.
>
> foo
>    bar
>       baz
>
> CR (Mac OS through 9) would give you a printout with each new line overprinting the last, leading to a black mess
>
> CR+LF was the only one that would properly carriage-return and line-feed conventions.  Well, LF+CR would work too, but who does THAT?
>
> So I wouldn't exactly call Windows' way "erroneous". ;)
>
> But yes, a good tool can deal with whatever you throw at it.


More information about the grlug mailing list