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:

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
bbyrd@PC:/var$ cd bin
bbyrd@PC:/var/bin$ pwd -P
bbyrd@PC:/var/bin$ mkdir asd
bbyrd@PC:/var/bin$ cd asd
bbyrd@PC:/var/bin/asd$ pwd -P

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:
Unsubscribe info:

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