On Fri, Jul 08, 2005 at 03:50:49PM +0200, demerphq wrote:
Im not sure if this is useful, but many of the things that File::Spec
tries to do on win32 are actually supported directly by the Win32 API.
IMO at least some of File::Spec's behaviour could take advantage of
this API.
Win32::GetFullPathName() is the one i have in mind when I say this.
perl -e "use Win32; print Win32::GetFullPathName(qq[foo\\..\\bar]);"
outputs "CWD\bar".
So if you strip off the CWD from the result of
Win32::GetFullPathName() you get the OS'es solution of this problem,
which should bypass all of these issues.
Im not sure if this is useful, but many of the things that File::Spec
tries to do on win32 are actually supported directly by the Win32 API.
IMO at least some of File::Spec's behaviour could take advantage of
this API.
Win32::GetFullPathName() is the one i have in mind when I say this.
perl -e "use Win32; print Win32::GetFullPathName(qq[foo\\..\\bar]);"
outputs "CWD\bar".
So if you strip off the CWD from the result of
Win32::GetFullPathName() you get the OS'es solution of this problem,
which should bypass all of these issues.
bar on Windows? Just because a system call does it that way doesn't mean
its right.
Anyhow, should this discussion drag on any longer without resolution there's
a simple yardstick to use: Which retains the most information? Not
collapsing .. does. So given that the current implementation is clearly
wrong, and if we can't decide between the two right implementations, pick
the one that's safest to at least give a correct answer. Then we can
discuss some more and maybe have switch to the other one.
--
Michael G Schwern schwern@pobox.com http://www.pobox.com/~schwern
'All anyone gets in a mirror is themselves,' she said. 'But what you
gets in a good gumbo is everything.'
-- "Witches Abroad" by Terry Prachett