Re: A patch for FAT & VFAT

Gabor Kuti (ksx@sch.bme.hu)
Tue, 17 Nov 1998 20:16:15 +0100 (MET)


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

Seasons
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
"One who has time to complain has time to submit patches." <chinese proverb>
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

-
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/