Jump to content

Long file names and why they are dangerous

Recommended Posts

Lot of talk about 'spurious' files in last time. But thing is not new at all. Windows 95 introduced long file names (LFN in further text), so it is far from new thing. But with today spread of cheap Flash cards and file transfers on them from some modern computer, OS  problem is more spread, so it's time to perform little education, and explain why and how .


Here is how it looks with some Hex editor, disk viewer:


ACSI view:


B .I.n.f.o...rr.


SYSTEM~1   ..&,B


Hex view of same:

42 20 00 49 00 6E 00 66 00 6F 00 0F 00 72 72 00
6D 00 61 00 74 00 69 00 6F 00 00 00 6E 00 00 00

01 53 00 79 00 73 00 74 00 65 00 0F 00 72 6D 00
20 00 56 00 6F 00 6C 00 75 00 00 00 6D 00 65 00

53 59 53 54 45 4D 7E 31 20 20 20 16 00 26 2C 42
9B 52 9B 52 00 00 2D 42 9B 52 FC 37 00 00 00 00


There are 3 32 byte long directory records for only 1 file visible above. Why 3 ? Because compatibility with classic DOS 8.3 filename DIR record standard, what is 32 long.

For file name self there are only 11 bytes, rest holds diverse data about file pos in partition, file size,  date, time stamp, and attributes. Latest is most interesting . And it is on pos 11 (starting with 0, as it goes in comp. world) .  It's hex $16 in lowest field, what is actually only one holding above mentioned file data. There are bits in that attribute byte, here set on, for: hidden file, system file, directory (3 bits set) .  In 2 records above it, attribute value is $0F - and that's the key here. It is value what never appears in normal usage, so they used that  as flag that it is extra DIR record field, and that's basically for storing long file name self - can be only 1 of such, or more than 2 if name is longer.  Will not go here in more details, there are online pages where can read more (as usual).

And now we can see why it is problem for TOS:  simply because they did not have time machine (what a lamers ? ), so they did not implement support for LFN in TOS.

Well, TOS just threats those extra DIR fields as regular ones, and in unlucky case those, mostly name related bytes will be seen as file length, position on partition data.

And file position data can be such, what is occupied with some regular file - ergo, potential data damage. If user tries to delete that messy filename one, will delete part of regular file actually. So, better don't even try it on Atari.


To add, that here can well see that regular DOS filename is with all capital letters, that ~1 at end is because there might be multiple long file names starting with same first 8 characters.


How to avoid LFN on Atari media ? I use Total Commander when copy files to Atari Flash cards, floppies. There is possible to uncheck 'Use Long Filenames' option, and then it will copy only 8.3 field. But that means not that user should not correct manually long filenames, if they are there. And they are there often, unfortunately today too, because some are still not aware of this problem. If it is just  papan.tos instead PAPAN.TOS it will be capitalized by Total Commander. But papanetina.tos will become PAPAN~E.TOS .

If doing usual copy, without forcing 8.3 filenames (by disabling Use Long Filenames) even papan.tos copy will create those unhealthy extra fields.

That would be all here (for now). Hope that helps.


  • Like 2
  • Thanks 2
Link to comment
Share on other sites

  • 2 weeks later...
  • 3 months later...

I used to use total Commander back in 90s on Windows 3.1 but now on Windows 10 I just can't figure out how to force the 8.3 filenames in total Commander ver. (x64) 10.00. :?

I did look in options and available plugins, I really could use this for my media transfer protocol & Teensy microcontroller hard drive implementation ( Yet another HD ACSI implementation with Media Transfer Protocol (WIP-Work in progress) ): ).

Link to comment
Share on other sites

17 hours ago, Chri O. said:

I used to use total Commander back in 90s on Windows 3.1 but now on Windows 10 I just can't figure out how to force the 8.3 filenames in total Commander ver. (x64) 10.00. :?


I use currently Total Commander 9.51 64bit . And it should be same in ver. 10, still.

So, Configuration, Options, Display - and there is "Use long names (recommended)" . Uncheck it for period when doing Atari file transfers, then check it back.

  • Thanks 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...