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

Re: PATCH: coprocess descriptor and error messages



On Thu, 16 Sep 2010 22:04:42 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> This seems somehow wrong to me ... starting from "zsh -f":
> 
> torch% print -p ; echo $?
> print: bad file number: -1
> 1
> torch% read -p ; echo $?
> 1
> 
> Seems to me that both commands should either fail silently, or print a
> more specific error.  Patch below does the former.  (Line numbers may
> be off.)  I won't commit until I see commentary.

The question is whether it's useful to be able to test whether the
coprocess is open at the same time as attempting to read or write.  If so,
doing it silently is reasonable.  Otherwise it might be less mysterious to
print "coprocess not open", or something like that, in both cases.

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


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom



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