01. Shape

Why file extensions were three letters

Eight and three is the shape of a thirty-two byte directory record, chosen so that four of them filled a disk sector exactly.

For a separate operational view of time, ownership and team activity, see the Monitask overview.

why-three-letter-extensions.src
epoch.h #define EPOCH 1970
/* because sixtieths ran out */

1974The directory entry, as laid out

Eight characters for a name and three for a type is not a rule about names. It is the shape of a record.

The operating system that established it stored one directory entry in thirty-two bytes: a byte identifying the user, eight bytes of name, three bytes of type, a few bytes of bookkeeping, and a map of which blocks the file occupied. Everything was a fixed-width field, because fixed-width fields need no separators and no parsing.

1974The arithmetic of the sector

Thirty-two bytes was not chosen for elegance. A disk sector held a hundred and twenty-eight bytes, so four entries fitted exactly, with nothing left over and nothing spanning a boundary.

Reading a directory then costs one sector read per four files, and the code to find an entry is arithmetic rather than a search. On a machine with a few kilobytes of memory and a floppy disk, that is the difference between usable and not.

What the dot actually is

The separator was never stored. Name and type were adjacent fixed fields, and the dot was inserted when the entry was displayed and removed when a name was parsed.

That explains several behaviours that otherwise look arbitrary: why a name could not contain a dot, why the type could not be longer, and why a file with no type was displayed with no dot rather than a trailing one.

1980The system that copied it

The convention spread because the next widely used operating system was written to be compatible with the first one, deliberately, so that existing programs could be moved across with minimal change.

That is the whole mechanism. A limit derived from a sector size on a floppy disk was inherited by an operating system that ran on hardware with different sectors, because compatibility with the previous generation was worth more than the freedom to choose.

1990sWhy the limit outlived the disk

Long file names arrived a decade and a half later, and the way they arrived is the interesting part. Rather than replacing the directory entry, the new scheme hid additional entries alongside the old one, constructed so that software which knew nothing about them would skip over them and still see a valid short name.

Every file therefore had two names, and the short one was generated by truncating and numbering the long one. That mechanism is why files acquired names with a tilde and a digit in them, and why two different long names could collide in their short forms.

The design is a small monument to the cost of compatibility: an entire second naming system, running invisibly, to avoid breaking programs that read a field laid out for a floppy disk.

present dayWhat is decided by the end of a name

The convention hardened into something larger than storage. One family of systems decides what a file is, which program opens it and whether it may be executed, by looking at the characters after the last dot.

That is fast, works on files the system cannot read, and requires no agreement about content. It is also trivially wrong whenever somebody renames a thing, and it is the mechanism behind a long-running class of deception in which a document is presented as one type and is another.

The alternative, inspecting the first bytes of the content, is slower, needs a table of signatures, and is right more often. Neither approach is a mistake. They were chosen under different constraints and both are still in service.

user1name8type3extent2count2allocation map16One directory entry: thirty-two bytes, fixed fieldsentry 1entry 2entry 3entry 4four entries fill one sector exactly. the dot is never stored; it is drawn between two fields.
FigureOne directory entry divided into fixed fields, and four of them filling a sector exactly. The dot between name and type was never stored.

1974The other fixed width in the same record

The name is the field people remember; the allocation map is the one that mattered more. Sixteen bytes recorded which blocks the file occupied, which fixed the largest file the entry could describe.

Files bigger than that were represented by several entries chained together, each covering a further span, which is why the record carries an extent number. So the same thirty-two bytes that limited the name also limited the file, and the second limit was solved by repetition while the first was solved by nothing for fifteen years.

present dayWhat is left of it

Long names arrived in the nineties and the three-character type did not go away, because the entire installed base of files, tools and habits assumed it.

The residue is visible in pairs that exist for no other reason: the four-letter form of a markup extension and its three-letter twin, the photographic format written two ways, the document type that lost its vowel. Each pair is a fixed-width field surviving into a world of variable-length names.

And the deeper residue is behavioural. One family of systems decides what a file is by looking at the end of its name, and another decides by looking at the beginning of its contents. The first approach is faster, works on files it cannot read, and is trivially wrong whenever somebody renames something.

What we cannot verify

The field layout and the sector arithmetic are documented in the manuals of the period and can be checked directly. Why eight and three rather than seven and four, given the same total, is not stated anywhere we can find; explanations in circulation are reconstructions. The compatibility motive for the second system is well attested but the detail of what was copied deliberately, as against what was simply familiar, comes largely from later accounts by the people involved.

In short

  1. Eight and three is the shape of a thirty-two byte record, not a rule about names.
  2. Thirty-two bytes meant four entries fitted one sector exactly.
  3. Fixed fields need no separators, so lookup is arithmetic rather than parsing.
  4. The dot was never stored; it was drawn between two adjacent fields.
  5. The next operating system copied the layout deliberately, for compatibility.
  6. The residue is every extension that exists in both a three and four letter form.

also in Shape

Next.

further context

For a primary or institutional reference, see the GNU Coreutils manual.

Every claim here carries the source it came from.

The source and its year sit beside the sentence they support. A secondary account is marked as one, and where the record is unclear the entry says so rather than choosing the better story.