edrdos icon indicating copy to clipboard operation
edrdos copied to clipboard

Are suffix-only filenames valid under DOS?

Open boeckmann opened this issue 1 year ago • 4 comments

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.

boeckmann avatar Sep 07 '24 12:09 boeckmann

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 avatar Sep 07 '24 12:09 ecm-pushbx

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

 A>echo foo > .qux
 File creation error

ecm-pushbx avatar Sep 07 '24 12:09 ecm-pushbx

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.

boeckmann avatar Sep 07 '24 12:09 boeckmann

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).

PerditionC avatar Sep 07 '24 12:09 PerditionC