[pmwiki-users] RFC: capitalization collision handling

Oliver Betz list_ob at gmx.net
Mon Mar 12 13:15:26 CDT 2007


Patrick R. Michaud wrote:

[force new links and pagenames to the existing capitalization]

> > > The problem is finding the "existing capitalization" -- at the moment
> > > there's not an easy way to do this on case-sensitive filesystems
> > > without doing a full scan of the wiki.d/ directory... and that can
> > > be a very expensive operation.  
> > 
> > I checked this with a quick perl hack using opendir/readdir to read a 
> > directory listing with 5000 entries into an array.
> > 
> > It takes 0,3s on my old 1GHz PIII (cygwin) and 0,02s at my web hoster 
> > (Linux, I have no clue how to get information about the hardware he's 
> > running).
> > ...
> > Since this check is needed only when a new or changed page is 
> > submitted, I would accept this small delay.
> 
> Actually, the check needs to be performed for every link that
> appears in a page at the time the page is displayed, not just when
> it is saved.  For example, if a page's markup contains [[wiki sandbox]], 
> then PmWiki has to determine if the WikiSandbox page exists so that it 
> knows what type of link to display.  (We can't do the check when the

The display of links isn't what I wanted to address but only the 
_creation_ of clashing groups or pages.

If the page doesn't exist (in the typed capitalization), it shouldn't 
be displayed as existing.

> page is saved... what if WikiSandbox doesn't exist at the time the
> page is saved but is then created afterwards?  Or vice-versa?)

O.k., that's not a "directory listing is expensive" problem, but it 
shows me another issue: If users create links in different 
capitalization to non-existing pages, the second page can't be 
created.

To handle this, also "wanted" pages could be considered "existing 
capitalization". Then there is still the possibility that a user 
submits two clashing links at once - this could also be handled, but 
I think it's not worth the effort to handle all this.

In my opinion it's enough to make the creation of conflicting pages 
and groups improbable.

It might seem to be a little inconvenient if a user gets an error 
message when he follows the (conflicting) link to create a new page, 
but consider what happens if he _can_ create the page - that's even 
worse.

So he gets the message that the page already exists in different 
capitalization and then he can repair the link. PmWiki doesn't need 
to take care about everything.

I also know that (without some locking between the directory scan and 
the page creation) it's not completely impossible to create 
conflicting groups or pages, but I think it reduces the possibility 
enough.

Oliver
-- 
Oliver Betz, Muenchen




More information about the pmwiki-users mailing list