On 7/9/05, Michael G Schwern <[EMAIL PROTECTED]> wrote:
> I'm not wedded to the name, but attached is a proof-of-concept of a routine
> which collapses updirs.  This is a solution to the problem whether or not
> canonpath() should collapse them.  Let the user decide.
> 
> 0 ~$ perl -w ~/tmp/foo.plx '../../bar'
> ../../bar
> 0 ~$ perl -w ~/tmp/foo.plx 'foo/../../bar'
> ../bar
> 0 ~$ perl -w ~/tmp/foo.plx '../foo/../../bar'
> ../../bar
> 0 ~$ perl -w ~/tmp/foo.plx '/../../../bar'
> /bar
> 
> There are some problems in Win32 and they look like they're due to
> File::Spec bugs.
> 
> 0 ~$ perl -w ~/tmp/foo.plx 'C:\foo\..\..\..\bar' Win32
> C:bar
> 
> This is because:
> 
> 0 ~$ perl -MFile::Spec::Win32 -wle 'print join "\n", 
> File::Spec::Win32->catdir("", "..", "..", "")'
> 
> It should be the root dir as it is on Unix.
> 
> 0 ~$ perl -MFile::Spec::Unix -wle 'print join "\n", 
> File::Spec::Unix->catdir("", "..", "..", "")'
> /


This should support a $base arguement just as rel2abs does. And on
WIn32 it should use GetFullPathName().

speak to you all in a long while im off to Toronto for a month...

cheers,
yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

Reply via email to