Re: A patch for FAT & VFAT

Khimenko Victor (khim@sch57.msk.ru)
Wed, 18 Nov 1998 21:40:10 +0300 (MSK)


17-Nov-98 20:16 you wrote:
>> Linux (V)FAT has been using conventions that are incompatible with
>> other OSes for quite some time now, which has caused me a lot of
>> trouble (having to rename files). The patch below will fix it.
>>
>> I've added a mount option - "case" - to the FAT file system. If
>> set to "asis", file names will be displayed the way NetBSD and the
>> Win95 DOS-prompt do.
>>
>> Also, Win95 generates long file name entries for short lowercase
>> names, but Linux VFAT didn't. It seems the fact that uppercase
>> characters are below lowercase in ASCII (not the other way round)
>> may have been overlooked.
>>
>> The patch will also be made available from:
>> ftp://mail1.bet1.puv.fi/incoming/
>>
>>
>> diff -ur linux-2.1.126/fs/fat/dir.c linux/fs/fat/dir.c
>> --- linux-2.1.126/fs/fat/dir.c Mon Aug 24 20:02:44 1998
>> +++ linux/fs/fat/dir.c Mon Nov 16 17:43:51 1998
>> @@ -9,6 +9,8 @@
>> *
>> * VFAT extensions by Gordon Chaffee <chaffee@plateau.cs.berkeley.edu>
>> * Merged with msdos fs by Henrik Storner <storner@osiris.ping.dk>
>> + *
>> + * Case-conversion made dependent on mount option / A. Wik, Nov 1998.
>> */
>>
>> #define ASC_LINUX_VERSION(V, P, S) (((V) * 65536) + ((P) * 256) + (S))
>> @@ -265,7 +267,8 @@
>> }
>> for (i = 0, last = 0; i < 8; i++) {
>> if (!(c = de->name[i])) break;
>> - if (c >= 'A' && c <= 'Z') c += 32;
>> + if (MSDOS_SB(sb)->options.lowercase &&
>> + c >= 'A' && c <= 'Z') c += 32;
> <deleted the rest of patch>

> Nice idea, I had some annoyance about it too once.
> What I would comment that as I know you may not relay that you use
> ASCII [c += 32] but should use tolower(3). [read manpage, do think of e.g.
> umlauts].
> And as I know in VFAT the first letter is shown as uppercase [in flying
> windozer..]. [but you may type them as you wish..]

ONLY explorer will show first letter as uppercase under Windows 9x and all
letters small under Windows NT. Far (ftp://ftp.creabel.com/pub/far) and
Netscape, for example, will show all letters big under Windows 9x and all
letters small under Windows NT -- I'm know this as windows developer :-)
This is REALLY annoying to have the same file under three different
names :-((( Especially in Netscape (in Netscape "Z" < "a" :-))

P.S. I'm talk NOT about File->Open Page in Netscape but about autogenerated
index for directories (something like file:///d|/ as URL -- you'll see
"WINDOWS" in Windows 9x and "windows" in Windows NT is you have dual boot
system like I am). Now Linux carefully follows Windows NT style.
Since NT was FIRST OS with VFAT support Linux do the "right thing" and
NetBSD and Windows 95 do the wrong thing. Still options could help someone.
Just not remove old behaviour!

P.P.S. For non-ascii letters this is not big problem since for such letters
LFN will be created unconditionally...

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/