Search code examples
filesystemsfat

Weird directory entries in FAT file system


So I'm trying to figure out how the FAT FS works and got confused by the root directory table. I have two files in the partition: test.txt and innit.eh which results in the following table:

Root directory table

The entries starting with 0xE5 are deleted, so I assume these were created due to renaming. The entries for the actual files look like this:

TEST   TXT *snip*
INNIT  EH  *snip*

What I don't understand is where the entries like

At.e.s.t......t.x.t
Ai.n.n.i.t.....e.h.

are coming from and what are they for. They do not start with 0xE5, so should be treated as existing files.

By the way, I'm using Debian Linux to create filesystems and files, but I noticed similar behaviour on FS and files created on Windows.


Solution

  • The ASCII parts of the name (where the letters were close to each other) is the legacy 8.3 DOS shortname. You see it only uses capital letters. In DOS, only these would be there.

    The longer parts (with 0x00 in between) is the long name (shown in Windows) which is Unicode, and uses 16bits per character.