FAQ

On 7/8/05, Glenn Linderman wrote:
On approximately 7/8/2005 1:53 PM, came the following characters from
the keyboard of Michael G Schwern:
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.

Does it? It still leaves us asking the question: can we assume foo\..\bar ==
bar on Windows? Just because a system call does it that way doesn't mean
its right.
In the presence of junction points, I think not. The system call would
have the opportunity to understand and check for the existance of
junction points, but whether it does or not, is anyone's guess, without
trying it.
Doesn't look like there is a problem with this. I guess ".." is
resolved by the OS relative to ".", and not a hard link to a specific
directory. (But that is pure speculation.)

D:\dev\junct\foo>perl -MWin32 -e"print Win32::GetFullPathName('.');"
D:\dev\junct\foo
D:\dev\junct\foo>cd ..\..\test

D:\dev\test>perl -MWin32 -e"print Win32::GetFullPathName('.');"
D:\dev\test
D:\dev\test>cd ..

D:\dev>junction junct\foo

Junction v1.03 - Win2K junction creator and reparse point viewer
Copyright (C) 2000-2002 Mark Russinovich
Systems Internals - http://www.sysinternals.com

D:\dev\junct\foo: JUNCTION
Substitute Name: d:\dev\test

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

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

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