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

chr at home.se chr at home.se
Thu Sep 29 02:36:02 CDT 2005

On Thu, 29 Sep 2005, Patrick R. Michaud wrote:

> On Thu, Sep 29, 2005 at 08:27:04AM +0200, chr at home.se wrote:
> > On Wed, 28 Sep 2005, Patrick R. Michaud wrote:
> > 
> > > Let me try to frame the overall problem a bit -- given a url 
> > > such as .../pmwiki.php?n=main.homepage, PmWiki has to determine the
> > > correct case of "main.homepage" so that it can be stored in $pagename.
> > 
> > What about ambiguities due to treating page names (or group names to a
> > lesser extent) without considering the case?
> > 
> > Let's theoretically say my name is Martin and I'm a doctor. I might then
> > decide to create a group called DrM, with the home page DrM.DrM. But
> > someone else might like to create a group called DRM (with the homepage
> > DRM.DRM), which would be about digital rights management.
> On a case-insensitive filesystem such as Windows, there's 
> absolutely no choice in the matter -- DrM.DrM is the same 
> page as DRM.DRM.

With the current implementation, sure. But my naive thinking is that
implementing something that could handle it isn't too diffcult.  You could
for instance maintain a separate file that maps page names to page files.
The penalty would be that you have to read this file into memory all the
time, just to access a page file. Or use the hash of the page name as the
file name. Both choices do imply that you lose the nice file names of

Heh... a funny combo would be to always store the file name in lower case
with an appended number that indicates which letters should be upper case.
For example, mypage-3 would indicate MyPage since 3 is 101 in binary and a
one signfies upper case. A slight drawback is that searching for a page 
file would mean having to search for "<page-name-in-lower-case>-*" to see 
if there are any variations of the page name.

Anyway, I generally favour taking advantage of the file system. Nor do I
care strongly about this. But... it does seem bit silly to let the
filesystem dicate this, compared to doing it by choice.

> I believe my answer to this will be that for administrators on
> case-sensitive filesystems, choosing to support case-insensitive urls is
> an option and the price of the option is that there can be ambiguities
> when there are two or more pages that differ only in case and a url
> refers to neither one exactly.

That'd be fine with me and I use case-sensitive filesystems.


Christian Ridderström, +46-8-768 39 44               http://www.md.kth.se/~chr

More information about the pmwiki-users mailing list