SvarDOS / edrdos

Enhanced DR-DOS kernel and command interpreter ported to JWasm and OpenWatcom C
http://svardos.org/
Other
37 stars 4 forks source link

Are suffix-only filenames valid under DOS? #110

Open boeckmann opened 1 month ago

boeckmann commented 1 month ago

Is a name like .TXT a valid filename under DOS? From a FAT directory entry perspective this should be allowed. But I am not sure how MS-DOS as a whole handles this.

ecm-pushbx commented 1 month ago

Hacking a ".QUX" file onto a diskette with my current MS-DOS v4 build works as far as "dir" showing it, but the "type" command ("File not found - .QUX") and int 21.3D (error 2) cannot access this file.

ecm-pushbx commented 1 month ago

It also seems that the file cannot be created or truncated:

 A>echo foo > .qux
 File creation error
boeckmann commented 1 month ago

Interesting. I asked because the parse_path routine does not seem to handle this case. It could be made to accept this with reasonable effort, but if this is generally not well supported under DOS then I think if would be better to leave it as is to have a defined point of failure.

PerditionC commented 1 month ago

filenames starting with . are only valid as lfn names as far as I recall. It is why for a long time Unix dotfiles caused problems for DOS conversions of some tools. Nothing in FAT filesystem technically prevents it, I believe it's an API issue that the . marks start of extension and therefore base name assumed to exist (not be blank).