[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

completion inconsistencies involving symlinks

From: Kartik K. Agaram
Subject: completion inconsistencies involving symlinks
Date: Wed, 30 Aug 2006 19:49:54 -0500

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' 
-DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -g -O2
uname output: Linux xxxxxxxx.cs.utexas.edu #1 SMP Wed Jul 12 14:41:00 
CDT 2006 i686 GNU/Linux
Machine Type: i686-pc-linux-gnu

Bash Version: 3.1
Patch Level: 17
Release Status: release

  If any part of cwd is a symlink, file completion when you try to navigate
  above that part follows the logical path. This is in conflict with all
  coreutils commands that use the physical path.


  In an ideal world I think bash's completion makes more sense than coreutils
  semantics. But after looking into coreutils sources and ext2 documentation
  I conclude that the 'logical path' is maintained only by the shell, not in
  the filesystem. If I'm right, then the whole notion of logical path is a
  leaky abstraction honored only by 'cd -L' (are there any others?). I would
  really like to be told I'm wrong.

  $ mkdir base_dir
  $ cd base_dir
  $ mkdir -p x/y
  $ ln -s x/y f
  $ cd f
  $ ls ..
  ##### Testing out tab-completion
  $ ls ../<Tab>
  f  x

  ##### stat("../x") returns ENOENT.
  $ cat > x.c

    struct stat buf ;
    int main () { printf ("%d %d\n", stat("../x", &buf), errno); }

  $ gcc x.c
  $ a.out
  -1 2

reply via email to

[Prev in Thread] Current Thread [Next in Thread]