On Thu, Dec 12, 2002 at 08:39:55PM +0000, Alex Hudson wrote:

> On Thu, 2002-12-12 at 19:21, Simon Wilcox wrote:
> 
> Maybe I'm barking up the wrong tree, but I don't think you can just
> 'throw away' bits of the directory path (i.e., ./somedir/../ != ./ ).
> 
> For example, on my system I can contrive a directory such that:
> 
> me$ cat ./one/../test/file
> foo
> me$ cat ./test/file 
> bar
> 
> [cut'n'pasted, not made up!]
> 
> Unless you were going to actually walk the directory path (much
> stattage), I'm not sure you can reduce directories with a simple
> algy-rhythm.
> 
> Given there's no pre-existing module, perhaps the reason is because to
> do it is wrong :o)

I wrote a module to do this six years ago to the day if I believe the
comment in the file.  500 lines doing all sorts of filesystem and path
stuff, before the stuff in the core was fully up to it.  It was part of
a build system I wrote, and it worked fine, but yes, those stats are
slow.

At the time I wasn't able to release it, but now I could.  However, I'd
want to rewrite a lot of it to use File::Spec, or somehow merge it with
that module, which is much improved over the last years, and I've not
really had the need nor the inclination to do that yet.

I do have some other modules that I keep thinking I should tidy up and
send out into the great big world, and they use this module, so I might
do something.  In the meantime, I could make this module available,
though it sounds like overkill for your needs.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

Reply via email to