Directories have the 0x10 bit set in the attribute field; files do not. The first byte is "." (0x2E) for self and parent directories, if present (which they aren't in the root).
The content of the directory "file" is an array of directory entries.
Ignoring long file names, the way you search for a file is:
- SearchDirectory = root
- Parse off 8.3 name from remaining path
- DirectoryEntry = Look up 8.3 name in SearchDirectory
- If remaining path is empty, then DirectoryEntry is the requested entity
- If Directory.Attribute & 0x10 == 0 then ERROR (expecting a directory)
- SearchDirectory = DirectoryEntry.contents
- Goto 2