This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Junctions + "pwd -P" = only skin deep resolution


Junctions seem to respond differently to symlinks with commands like "pwd -
P", getcwd(), or Perl's Cwd::getcwd.  This is the last stop of a wild goose 
chase for a bug that I thought was centered around File::chdir.  More 
details here:

https://rt.cpan.org/Ticket/Display.html?id=84988

However, upon further inspection, the buck stop here.  Here's the problem:

Let's say I have a junction of /var/bin pointing to /usr/local/bin.  It 
looks just like a symlink in a "ls -l" on /var

lrwxrwxrwx  1 bbyrd Domain Users 14 May  8 20:23 bin -> /usr/local/bin

So, starting from /var, here's what I get from "pwd -P":

bbyrd@PC:/var$ pwd -P
/var
bbyrd@PC:/var$ cd bin
bbyrd@PC:/var/bin$ pwd -P
/usr/local/bin
bbyrd@PC:/var/bin$ mkdir asd
bbyrd@PC:/var/bin$ cd asd
bbyrd@PC:/var/bin/asd$ pwd -P
/var/bin/asd

What the hell?  Everything was going fine until you dive deeper into the 
directory, past the junction point.  This should have read 
"/usr/local/bin/asd", since the "-P" means to find ALL of the symlinks and 
resolve them.

This actually works exactly like that with symlinks, but symlinks suck 
outside of Cygwin.  (Windows just gives me a stupid "System folder" in 
Explorer.)  I'd like to have the best of both worlds: Junctions that play 
nice in both Cygwin and Windows.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]