* bug with parent directories and symlinks
@ 2004-03-03 22:11 Trey Smith
0 siblings, 0 replies; 2+ messages in thread
From: Trey Smith @ 2004-03-03 22:11 UTC (permalink / raw)
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
execute
(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".
-Trey
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: bug with parent directories and symlinks
[not found] <mailman.1137.1078561378.340.bug-gnu-emacs@gnu.org>
@ 2004-04-09 21:55 ` Kevin Rodgers
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Rodgers @ 2004-04-09 21:55 UTC (permalink / raw)
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
> execute
>
> (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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-04-09 21:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-03 22:11 bug with parent directories and symlinks Trey Smith
[not found] <mailman.1137.1078561378.340.bug-gnu-emacs@gnu.org>
2004-04-09 21:55 ` Kevin Rodgers
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).