Re: Msdos name alias patch for 2.1.48

Albert D. Cahalan (acahalan@cs.uml.edu)
Fri, 8 Aug 1997 18:43:35 -0400 (EDT)


Werner Almesberger writes:
> Albert D. Cahalan wrote:
>
>> There is a solution that gets rid of all the gross hacks.
>> The official FAT filesystem has long case-preserving filenames.
>
> Hmm, are you proposing to _store_ mixed case in an old FAT FS ?

No way!

> If you're proposing just to remember the case (in a cache) but to
> store the "normal" name in the FS, then you have three problems:

Nope, not that either.

For plain msdos, non-canonical is always illegal. If that is a
problem for you, use vfat. Vfat is the official FAT filesystem.

For vfat, the canonical name is whatever mixed-case name is
(or will be) stored on the disk. Accept only that. If there
is a FILEname.Txt, then applications must use that. Any other
version (like filEnamE.tXt) is not accepted until you remove
the existing version. That prevents accidental overwrites.

>> We should only match on the name that shows up in a
>> directory listing.
>
> This would create horrible compatibility problems with
> programs that transform file names, e.g.
>
> % touch foo.bar

Here the file lists as "foo.bar". Since that exists, the file
called "foo.BAR" is locked out to prevent aliasing trouble.
Rename or remove "foo.bar" if you want to make "foo.BAR".
It is OK to rename from "foo.bar" to "foo.BAR", with no need
for any special code.

> % dosemu_script foo.bar
>
> which does the equivalent of
>
> do_sth_with `basename $1`.BAR
>
> (Okay, maybe that's a slightly exotic case ;-)

Doesn't that already fail on ext2 filesystems?
(if is works on ext2, then it works with my proposal too)
DOSEMU is responsible for name mangling anyway.