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

Re: _canonical_path not working on *BSD



Le Wed, 26 Mar 2008 15:34:09 +0000,
Peter Stephenson <pws@xxxxxxx> a écrit :

> 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?
> 

On OpenBSD:

[pea@coredump:~]% readlink -f / >&/dev/null ; echo $?
0

But readlink -f exists on netbsd only since release 4.0. Older release
doesn't have this option.

Regards.



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