SvarDOS / edrdos

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

Are suffix-only filenames valid under DOS? #110

Open boeckmann opened 2 months ago

boeckmann commented 2 months 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 2 months 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 2 months ago

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

 A>echo foo > .qux
 File creation error
boeckmann commented 2 months 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 2 months 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).