Re: Filename clashes in datadir

seanh <[email protected]> Wed, 17 Nov 2010 11:39:46 +0000
Newsgroups gmane.comp.web.pyblosxom.devel
Message-ID <20101117113946.GA1502@dulip>
On Wed, Nov 17, 2010 at 09:09:43AM +0100, Dieter Plaetinck wrote:
> On Wed, 17 Nov 2010 01:11:10 +0000
> seanh <[email protected]> wrote:
> 
> > Hey, I just noticed something about pyblosxom. What if I have the
> > following two files in my datadir:
> > 
> > 	foo.txt
> > 	foo.markdown
> > 
> > The first is handled by the built-in entry parser, the second by the
> > markdown entry parser plugin. Both entries will appear in pyblosxom's
> > index pages. But both have the same permalink URL:
> > 
> > 	${base_url}/foo
> > 
> > So when someone visits that URL in a browser, which entry should
> > pyblosxom render? It seems to pick one or the other but I'm not how it
> > makes the decision.
> > 
> > I guess blosxom must have this problem also?
> > 
> > The problem is caused by using different filename extensions in
> > datadir to select the entry parser. If instead you required all
> > entries to have the same filename extension (maybe .txt, or .entry)
> > then by the properties of the filesystem it would be impossible for
> > the user to create two entries with the same permalink URL. Entry
> > parser plugins could be specified in the optional metadata section
> > inside the entry files instead.
> 
> IMHO this is a user problem, not a pyblosxom problem.
> Users shouldn't use the same basenames with different extensions, if
> that causes unwanted behavior.

I have to come to the same conclusion. My suggested solution above
wouldn't work, you can't specify the entry parser inside the entry file
contents because the entry parser obviously needs to be selected before
parsing the file.

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev