FAQ

On 7/9/05, Ken Williams wrote:
On Jul 8, 2005, at 4:50 PM, yves orton via RT wrote:

Sorry, i guess I didnt express myself properly. You cant clean up a
relative path properly without knowing where it is relative to.
Consider the following path:

..\..\foo

If we are in \bar then ..\..\foo is the same as ..\foo and \foo but
if we are in \bar\baz\bat then its not the same as either as it maps
to \bar\foo.
The current working directory is not considered in canonpath(), period.
canonpath("../../foo") is "../../foo".
As I said before, the docs DONT specify what canonpath() is for very
well. All of this stuff is inferred or implied. Personally i dont feel
bad in coming up with a interpretation of what canonpath() is for that
differs from your own, or Schwerns, when the docs do not actually
explicitly say what it does.

One can infer almost any behaviour from "cleans up the path". And IMO,
whether looking at cwd or not is included in "does not look at the
filesystem" is unclear.

Im happy with the behaviour you outline, and i think i like Schwern's
idea of a collapse path or whatever. But id like to see this stuff
spelled out in the File::Spec docs properly.

OTOH, i still think canonpath for absolute paths on Win32 should use
GetFullPathName().

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

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 15 of 19 | next ›
Discussion Overview
groupperl5-porters @
categoriesperl
postedJul 6, '05 at 9:00p
activeJul 12, '05 at 1:15a
posts19
users5
websiteperl.org

People

Translate

site design / logo © 2022 Grokbase