delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/11/16/10:03:22

Message-ID: <B0FEA00E82A7D1118BFB00A0CC99027821341A@ARGON>
From: Michel de Ruiter <Michel AT smr DOT nl>
To: "'djgpp-workers AT delorie DOT com'" <djgpp-workers AT delorie DOT com>
Cc: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>,
"'Laurynas Biveinis'"
<lauras AT softhome DOT net>
Subject: RE: First alpha symlink patch
Date: Tue, 16 Nov 1999 09:49:03 +0100
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Reply-To: djgpp-workers AT delorie DOT com

> > Are getwd and getcwd documented somewhere to return the
> > symlink name, rather than the actual directory name?  If not,
> > perhaps we are better off without recording the symlink in
> > some hidden variable?
> It's up to implementation. If we do or do not do that we got following
> difference, as pointed out by Alain when we discussed it earlier:
> --------
> When you say chdir() should be adjust, how ? see two different
> behaviours below (Solaris vs GNU/Linux) of chdir() :

Are you sure this difference is not because of a different configuration
of Bash? IIRC, Bash has an option to change its behaviour regarding
this. From a (probably old) Bash Info-file:

Node: Bash Variables
...
`nolinks'
     If present, says not to follow symbolic links when doing commands
     that change the current working directory.  By default, bash
     follows the logical chain of directories when performing commands
     such as `cd' which change the current directory.

     For example, if `/usr/sys' is a link to `/usr/local/sys' then:
          $ cd /usr/sys; echo $PWD
          /usr/sys
          $ cd ..; pwd
          /usr

     If `nolinks' exists, then:
          $ cd /usr/sys; echo $PWD
          /usr/local/sys
          $ cd ..; pwd
          /usr/local

     See also the description of the `-P' option to the `set' builtin,
     *Note The Set Builtin::.
...
Node: The Set Builtin
...
    `-P'
          If set, do not follow symbolic links when performing commands
          such as `cd' which change the current directory.  The
          physical directory is used instead.

Maybe we should leave this option to Bash, not libc.

Groente, Michel.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019