lovingboth: (Default)
Ian ([personal profile] lovingboth) wrote2005-12-20 11:41 pm
Entry tags:

Legacies

I needed to write a quick program to extract some data from a binary file today, so I reached for Borland Pascal 7. The actual program took a couple of minutes to get right... most of it because of a 'feature': if you open a file in binary (as opposed to text) mode, you have to say how many bytes you will read at a time.

If you forget - as I do every so often - it defaults to... 128 bytes.

Why 128 bytes rather than one?

Because that was the size of a sector on the original 8" floppy disk, which had 77 tracks of 26 sectors back in the early 1970s. Early versions of CP/M could only read and write in 128 byte chunks, and Turbo Pascal was originally released for CP/M, so that was the sensible value for the default.
vampwillow: (Default)

[personal profile] vampwillow 2005-12-21 12:38 pm (UTC)(link)
Actually, one could hard-format an 8" floppy (::rude alert!::) however you wanted to do (an early job of mine was writing interfaces for the beasts) but even now I still try to compact data storage into sectors ... it has become 'inbred' ...