[pmwiki-users] Re: case-insensitive file names (Was: How use lowercase in Group Names)

Patrick R. Michaud pmichaud at pobox.com
Thu Sep 29 10:04:12 CDT 2005

On Thu, Sep 29, 2005 at 04:22:43PM +0200, chr at home.se wrote:
> Just out of curiosity, what did you think of appending an additional token
> that indicates the case?  I just realized a hyphen doesn't work since it's
> allowed in a page name, but a dot would. We'd then get these examples:
>   Page			Case-bits 	(hex)	File name
>   main.abc		0000, 000 	0x00	main.abc.0
>   main.ABC		0000, 111 	0x07	main.abc.7
>   Main.Abc		1000, 100 	0x44	main.abc.44
>   Long.PageName		1000, 10001000	0x0111	long.pagename.111
>   LongGroup.LongerName	100010000, 1000001000  0x44208
> 						longgroup.longername.44208
> It's kind of cute, but probably very confusing for someone looking at 
> wiki.d/  ;-)

It is very cute, and confusing.  I would probably order the bits
differently, so that character 0 of the name corresponds to bit 0,
character 1 with bit 1, etc.  Thus for the above I would probably end
up with:

                        cba. niam
   main.abc		0000 0000                 main.abc,x00
   main.ABC		1110 0000                 main.abc,xe0
   Main.Abc		0010 0001                 main.abc,x21

   Long.PageName	0 0010 0010 0001          long.pagename,x221
   LongGroup.LongerName	0001 0000 0100 0001 0001  longgroup.longername,x10411

But regardless of the bit sequence, this approach doesn't really
help us with case insensitivity -- we still go through the same
process.  For example, given a page name such as "Main.AbC", we
still look for a file exactly matching the case (i.e., "main.abc,xa1")
and if it's not found we do a scan of the directory looking for
any file that matches "main.abc,*".  So, we still have the directory
scan taking place in pretty much the same way as we would if
the files were stored as "Main.Abc".

Going the other way -- i.e., providing case sensitivity for
filesystems that don't have it -- an easier approach might be 
to place a special character in front of each letter that is
truly uppercase.  Thus (assuming underscore here):

    Main.Abc               "_Main._Abc"
    Main.ABC               "_Main._A_B_C"
    Long.PageName          "_Long._Page_Name"
    Long.Pagename          "_Long._Pagename"
    LongGroup.LongerName   "_Long_Group._Longer_Name"

But I don't imagine there will be much demand for case sensitive
page names, thus anything like this is *definitely* left to a Cookbook
recipe.  :-)


More information about the pmwiki-users mailing list