FAQ

On Sat, Jul 09, 2005 at 08:14:47AM +0200, demerphq wrote:
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.
Yes, the docs stink. Patches welcome.

OTOH, i still think canonpath for absolute paths on Win32 should use
GetFullPathName().
A) Why change what works?
B) The docs for GetFullPathName() read more like rel2abs() than canonpath().

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/getfullpathname.asp
GetFullPathName merges the name of the current drive and directory with a specified file name to determine the full path and file name of a specified file.

C) Its not specified in the GetFullPathName() that it does the sort of
canonicalizing we expect. It might *happen* to do it now but who knows
later.

D) File::Spec::Win32 will no longer work on non-Windows platforms making
cross-platform development and testing just that more frustrating.


--
Michael G Schwern schwern@pobox.com http://www.pobox.com/~schwern
Don't try the paranormal until you know what's normal.
-- "Lords and Ladies" by Terry Prachett

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 18 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