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

Re: _canonical_path not working on *BSD



Baptiste Daroussin wrote:
> This only work on OpenBSD, readlink on FreeBSD doesn't allow -f.

I think that means the function won't do what it's designed to do,
right?  So in that case we should test if readlink accepts -f and if it
doesn't, then return immediately.  However, that may not be a trivial
test.  How about something like

[[ -n $(readlink -f / 2>&1 >/dev/null) ]]

(for which we could cache the result)?  Or is testing that
"readlink -f / >&/dev/null" returns status 0 good enough?

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



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