[Top][All Lists]

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

Re: bug with parent directories and symlinks

From: Kevin Rodgers
Subject: Re: bug with parent directories and symlinks
Date: Fri, 9 Apr 2004 15:55:47 -0600
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv: Gecko/20020406 Netscape6/6.2.2

Trey Smith wrote:

This bug report concerns emacs version 21.2.1 on linux.

The problem relates to handling of parent directories in the presence of
symlinks.  The following section explains how to replicate the problem.

Setup steps:

  cd /tmp
  mkdir -p foo/bar
  ln -s foo/bar bar
  echo 'this is my file' > foo/myfile
  cd bar

At this point we are in the "/tmp/foo/bar" directory, and there is a
file "/tmp/foo/myfile" which includes some text.  If we run emacs and

  (find-file "../myfile")

Emacs will open "/tmp/myfile" instead of "/tmp/foo/myfile" as it should.

This problem is particularly annoying when compiling C code under emacs,
because the compiler sometimes outputs header filenames in errors using
a relative path that includes "..", and attempting to jump to the file
containing the error fails.

The suggested fix is to not calculate ".." internally in emacs, but
instead to use the filesystem.  In the above example, opening
"/tmp/bar/../myfile" from the shell correctly yields "/tmp/foo/myfile".
Opening "/tmp/bar/../myfile" from emacs incorrectly yields "/tmp/myfile".

C-h v find-file-visit-truename

Kevin Rodgers

reply via email to

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