Hello Eric,

However, NEITHER the file name length NOR the length of the
extension are checked for allowed length! I believe you could
tell function 3d to open "textfiletxt" and it would in reality
open "textfile.txt" because the 11 character basename overflows
into the memory reserved for max 3 bytes of file name extension.


At least on FreeDOS 1.0, "textfiletxt" is simply treated as "textfile",
and "textfile.txtgarbage" as "textfile.txt".  Excess characters in the
file name base and the extension are ignored.  And multiple dots are
simply not allowed in file names.  And I see that MS-DOS works pretty
much the same way.

In a way, DJGPP --- and also my IA-16 GCC --- kind of relies on this
name truncation behaviour, on systems without LFN support.

The GNU toolchain sources have lots of non-8.3 file names all over the
place.  So on DOS, basically they try to access files and programs using
their original full names (e.g. "ld.gold", "_newlib_version.h") while
the actual files stored on disk have truncated file names (e.g.
"ld.gol", "_newlib_.h").

This works as long as the full names are unique within the first 8.3
characters, and there are no file names or directory names such as
"6.3.0" and the like.

If any excessively long base names or extensions do really cause the
system to crash or weird out, _then_ (IMO) that will be a very bad bug.
:-)  But as far as I can tell, this has not happened yet.

Thank you!

--
https://github.com/tkchia


_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to