This is the mail archive of the cygwin@sourceware.cygnus.com 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]

Broken pwd or how can I resolve symlnks?


Hello!

I noticed then when I have a symlink to a directory and the make cd to the symlink, 
pwd does not print the directory link points to. I.e.:
cd //d/tmp
mkdir a
ln -s a b
cd b
pwd
//d/tmp/b
       ^^^
when I expect that last pwd should print 
//d/tmp/a

The similar problem comes from cygpath utility. 
It does not resolve simplinks in path components.
Example:

cd //d/tmp
touch a.txt
ln -s a.txt b.txt
cygpath -w b.txt
d:\tmp\b.txt

when the last cygpath should IMHO print a.txt.

I tried to resolve a problem with cygpath and what I realized is that the function

extern "C" void cygwin_conv_to_win32_path(
    const char *path, char *win32_path);

does not resolve symlinks either.

Well, I can write my own version of cygpath that does not have this problem but then I will depends on the exact knowledge of symlink file format because very useful function readlink is absent from the cygnet api...

So maybe there is a better way to resolve that symlinks problem?
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


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