zsh-users
 help / color / mirror / code / Atom feed
* Inconsistent behaviour of cd and AUTO_CD
@ 2002-03-09 23:46 Vincent Lefevre
  2002-03-13 11:35 ` Oliver Kiddle
  0 siblings, 1 reply; 2+ messages in thread
From: Vincent Lefevre @ 2002-03-09 23:46 UTC (permalink / raw)
  To: zsh-users

With zsh 4.0.4 and AUTO_CD, under Linux and ext3 filesystem type:

ay:~> mkdir blah
ay:~> cd blah
ay:~/blah> ..
ay:~> cd blah
ay:~/blah> rmdir ../blah
ay:~/blah> ..
zsh: permission denied: ..
zsh: exit 1     ..
ay:~/blah[Failed 1]> cd ..
ay:~>

The problem is that after the rmdir, "ls -a" no longer lists . and ..
(though doing something like "cat > .." gives the following error:
"zsh: is a directory: .."). When using ".." only, the directory can't
be found, but when using "cd ..", zsh assumes that the directory ..
still exists.

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/> - 100%
validated (X)HTML - Acorn Risc PC, Yellow Pig 17, Championnat International
des Jeux Mathématiques et Logiques, TETRHEX, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Inconsistent behaviour of cd and AUTO_CD
  2002-03-09 23:46 Inconsistent behaviour of cd and AUTO_CD Vincent Lefevre
@ 2002-03-13 11:35 ` Oliver Kiddle
  0 siblings, 0 replies; 2+ messages in thread
From: Oliver Kiddle @ 2002-03-13 11:35 UTC (permalink / raw)
  To: zsh-users

Vincent Lefevre wrote:

> With zsh 4.0.4 and AUTO_CD, under Linux and ext3 filesystem type:
> 
> ay:~> mkdir blah
> ay:~> cd blah
> ay:~/blah> ..
> ay:~> cd blah
> ay:~/blah> rmdir ../blah
> ay:~/blah> ..
> zsh: permission denied: ..
> zsh: exit 1     ..
> ay:~/blah[Failed 1]> cd ..
> ay:~>

Yes, clearly this is inconsistent. If you set either of the chase_links
or chase_dots options, the .. implicit cd will work like the explicit
one. Note that I don't think the filesystem type, operating system or
zsh version makes any difference to this (except IRIX doesn't let me
remove the directory). In fact, even tcsh has this exact same
inconsistency.

The problem is in the cancd2() function in exec.c. It only tries an
implicit cd after establishing that the target is an accessible
directory. With chase_dots, it first resolves the target to $PWD:h so
it works. And for the cd command it doesn't have to decide what it is
doing so it just does the cd.

So cancd2() somehow needs to do a better job of resolving what the
target directory is before determining if it is accessible. I don't
fully understand the semantics of no_chase_dots to know how it should
do this. Any ideas?

Oliver

-- 

This e-mail and any attachment is for authorised use by the intended recipient(s) only.  It may contain proprietary material, confidential information and/or be subject to legal privilege.  It should not be copied, disclosed to, retained or used by, any other party.  If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender.  Thank you.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-03-13 11:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-09 23:46 Inconsistent behaviour of cd and AUTO_CD Vincent Lefevre
2002-03-13 11:35 ` Oliver Kiddle

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).