On Fri, Mar 18, 2016, at 13:12, scj(a)yaccman.com
wrote:
It may seem strange to us today, but in the
context of the day, one of
the most radical ideas in Unix was the concept of a file as an array of
bytes, with lines separated by newline characters. Most mainframes had
file
systems that were more or less decks of cards on disk
Of course, I assume the answer to the question of why everyone didn't do
that is that there's a trade-off: We take for granted today that you
can't change a line in the middle of a text file without moving
everything after it, either by reading the whole thing into memory and
writing back the changed version, or creating a copy of the file with
the changes and replacing the original with it afterwards, but I assume
these "deck of cards" style files had provisions for editing one in the
middle. You also can't seek to a given line number in a file.
At least in my experience, editing the "deck of cards" (and certainly,
editing anything on magnetic tape) was really painful -- there was no way
to move blocks of text around -- you started at the beginning of the file
and had to edit lines in order (one shot per line) until you got to the
end. You could add lines or delete them, but only when you came to them.
The editor copied the edited file into an output file, and then you had to
do another step to copy the new version back over the original one.
Shortly after we had a user-writable disc in the Murray Hill computation
center, I (working there as a summer intern) was delighted to copy the
2000 card file I had been lugging around onto disc, and dump the cards.
As it turns out, my boss also dumped his copy of the card deck.
The first time I tried to edit the deck on disc, I specified the output
file to be equal to the input file. The program did not check this, and I
ended by nuking about 20% of the card images! Luckily I had a listing...
I punched out the trash on the disc and spent an entire weekend
rearranging and repunching the cards to get back to where I had been...
It just goes to show that I should have taken my mother's advice -- before
you throw out a deck of cards, put a rubber band around it!