Format of options file

MacFH - C E Macfarlane c.e.macfarlane at macfh.co.uk
Mon Mar 5 11:01:24 PST 2018


We could argue about this for hours, but I have no desire to do so  -  
there are things I like and others I detest about both OSs, and the 
thread's becoming increasingly OT.  I answer one specific point below, 
but anyone not interested in computer history and debugging programs can 
safely ignore ...

On 05/03/2018 13:36, Ralph Corderoy wrote:
>
>> Arguably the oddballs are Linux and perhaps Macs, using only one.
>> This would mean that if their text was sent directly to a teleprinter,
>> the output would not be what is required, but of course these days
>> that would seldom if ever be done.
> But in those days of Multics and Unix that's precisely what was done
> with Unix text files, terminated by just LF, and yet the text didn't
> stagger across the page because a device driver was correctly the thing
> that knew what a particular device needed to be sent as bytes;  the file
> format wasn't the place for that.  Other characteristics include a
> timing delay to allow for the carriage to return before sending more
> bytes.
Don't forget that the earliest teleprinter style devices date back as 
far as at latest WW2, for example the German Lorenz machine which also 
applied cryptography  -  and I don't believe the concept of 
'device-driver' existed then; nor am I questioning the use of device 
drivers, obviously they make a lot of programming sense.  What I'm 
questioning is the wisdom, perhaps that should be rank stupidity, of 
using LF as the line-terminator, while treating a preceding CR as part 
of the line text.  That completely f*d backward compatibility with what 
had gone before.  You say that it is C based, but my recollection of C's 
internal representation is that strings are NULL terminated, and that 
also might have been a more logical choice of line-terminator for Unix.

At any rate, we have the mess we have, and I join with Bernard in 
deploring it.  I can think of at least two baffling examples that have 
afflicted me in the past, one in each direction ...

The first concerned a Psion Gold modem PCMCIA card, installation of the 
Windows drivers for which broke not only use of that card, but any 
previously similar card using the same INI file.  I wasn't the person 
who wrote this original installation script, from what I can recall that 
had been, shudder, a contractor, but the mess was given to me to sort 
out.  After I'd corrected all the usual contractor horrors, like failing 
to get the Windows and Temp directory names from the environment, and 
the hard-coding of them and other non-constant-across-different-machines 
values repeatedly all the way through the script, I was still left with 
a script that didn't work.  Now that I had cleaned it up, the script 
appeared to be doing everything it should have, and should have worked 
on any machine in the firm, and the resulting INI file looked alright, 
yet nothing was working.  It occurred to me that perhaps there was some 
hidden character in the INI file supplied by Psion, which we were 
editing via the script, so I loaded it as hex into TextPad and, lo and 
behold, Psion had supplied a *Windows* INI file with *Unix* line 
endings!  Obviously, I could have just loaded the file as text into 
Textpad and saved it with Windows line-endings, but this would not have 
helped the many people who had already tried the installation and had it 
fail.  I had to adapt the script further to clean up any pre-existing 
mess from a previous installation by correcting the line endings in 
their existing INI file.  Thus this incompatibility between line endings 
created a ridiculous amount of lost productivity and extra work.

The second occasion was that I created a Linux bash script on a Windows 
machine using TextPad, but failed to remember to save it with Unix line 
endings.  Because it was interpreting the CRs as part of the line, the 
errors given were baffling.  I tried posting the script in one or more 
Linux newsgroups, but nobody could suggest what might be going wrong, 
and I moved on to other things for a while.  It was only when I came 
back to it and started trying things almost at random, that after a few 
hours I came to realise what the problem was.  Again, so much time 
wasted, for so little a reason.




More information about the get_iplayer mailing list