/bin/pwd (getcwd) and symlinks

Earnie Boyd earnie_boyd@yahoo.com
Wed Oct 18 05:44:00 GMT 2000


--- Andrej Borsenkow <Andrej.Borsenkow@mow.siemens.ru> wrote:
> If a current directory is symlink, getcwd() on Unix returns directory, to
> which this symlink points, while on Cygwin it returns directory itself:
> 
> mw1g017@MW1G17C% ls -l . sub
> .:
> total 0
> drwxr-xr-x   2 mw1g017  ITS             0 Oct 18 15:40 real
> drwxr-xr-x   2 mw1g017  ITS             0 Oct 18 15:40 sub
> 
> sub:
> total 1
> lrw-r--r--   1 mw1g017  ITS            18 Oct 18 15:40 fake -> ../real
> mw1g017@MW1G17C% cd sub/fake
> mw1g017@MW1G17C% /bin/pwd
> /tmp/sub/fake
> 
> while on Unix this returns /tmp/real.
> 
> Is it intentional?
> 

It's implementation depedant.  On my HP-UX system it returns the symbolic link
name.  I could find no documentation stating that it should return the actual
directory.

Cheers,

=====
Earnie Boyd
mailto:earnie_boyd@yahoo.com

---         < http://earniesystems.safeshopper.com >         ---
--- Cygwin: POSIX on Windows < http://gw32.freeyellow.com/ > ---
---   Minimalist GNU for Windows < http://www.mingw.org/ >   ---

__________________________________________________
Do You Yahoo!?
Yahoo! Messenger - Talk while you surf!  It's FREE.
http://im.yahoo.com/

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list