Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: _canonical_path not working on *BSD
- X-seq: zsh-workers 24746
 
- From: Pea <zsh@xxxxxxxxxxxx>
 
- To: Peter Stephenson <pws@xxxxxxx>
 
- Subject: Re: _canonical_path not working on *BSD
 
- Date: Wed, 26 Mar 2008 16:51:28 +0100
 
- Cc: Baptiste Daroussin <baptiste.daroussin@xxxxxxxxx>, zsh-workers@xxxxxxxxxx
 
- In-reply-to: <200803261534.m2QFY9L1017279@xxxxxxxxxxxxxx>
 
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
 
- Organization: Raveland
 
- References: <20080326114413.80713vrmznwpnyuc@xxxxxxxxxxxxxxx>	<20080326150552.52b3f1c4@news01>	<20080326162710.20476ooqf5nlulwc@xxxxxxxxxxxxxxx>	<200803261534.m2QFY9L1017279@xxxxxxxxxxxxxx>
 
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