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

Re: _canonical_path not working on *BSD



On Mar 27, 10:23am, Peter Stephenson wrote:
}
} I should make one more point about this before leaving the subject: this
} doesn't do everything that "readlink -f" does, in particular it doesn't
} remove .. path segments, strip multiple /'s or remove symbolic link
} references in intervening directories.
} 
} Luckily, we have the technology, I think.
} 
} We don't need the $(...) for the zstat.  It would be quite nice to
} be able to get the directory canonicalization without a fork, too.

Why do we even need the zstat if we're doing $(cd ...; pwd) ?  I used
zstat in the first place to avoid having to cd to a directory that might
not be readable/executable (though I suppose "umount" would normally be
used by root) but if you're going to cd anyway then you can skip the
whole "while" loop on zstat and just "pwd -P" once.

Or better, try the "pwd -P" first and fall back on the while loop.

(Or did your most recent patch do that?  I've lost track.)

I'm beginning to think this whole exercise is a bad idea anyway.  I have
visions of sysadmins attempting to umount a misbehaving NFS server or a
failing disk and ending up with their session frozen as zsh attempts to
access the bad filesystem behind the scenes.



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