Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: `cd .` in non-existent directory leads into weird corner case



On Apr 3, 12:16pm, Mikael Magnusson wrote:
}
} I don't know if this is something that works on all systems, but on
} linux at least, it seems that the directory inode sticks around while
} a process still has it, or any subdirectory of it, as its current
} directory (or otherwise open i suppose). This means that it is still
} possible to access the . and .. entries in it, and follow them

In order to do this even remotely portably, though, zsh would have to
open ".." with readdir() as soon as it cd's into a directory, and then
hold open that descriptor until it cd's out again; plus the system
would have to support fchdir() -- I don't know how portable that is
compared to /proc/*/cwd but I'm pretty sure neither of them is going
to be available on every platform where zsh can be compiled.



Messages sorted by: Reverse Date, Date, Thread, Author