Subject: Re: cache_*() case-insensitive searching
To: None <tech-kern@netbsd.org>
From: Bill Studenmund <wrstuden@nas.nasa.gov>
List: tech-kern
Date: 08/10/1999 09:34:26
On Tue, 10 Aug 1999, Ignatios Souvatzis wrote:

> You can't do this (case-insensitiveness) file system independent.

We kinda can. :-)

> Some filesystems come in defined flavours of charset (e.g. ADOSFS), and
> have different caseness properties dependend on this.
> Some filesystems have no defined character set.
> Some filesystems have US-ASCII.
> Some filesystems have CP437.
> Some filesystems have iso-8859-1.
> Some filesystems have Unicode.
> Some filesystems have EBCDIC.
> 
> if at all, the filesystem code might know what is right.

I see it was touched on later in the tread, but we can do the cache lookup
fs-independent.

We keep two copies of the name in the cache. One is the as-on-disk name
(with "case" whatever that is) and the other is the "canonicalized" name.
For a file system with case insensitivity, the "canonicalized" name would
be, say the lower case name. For hfs, where accented letters colate with
non-accented ones, the canonicalization would strip accents.

Take care,

Bill