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

Re: exec {_Dbg_new_fd}<>&-



"Rocky Bernstein" wrote:
> exec {_Dbg_fd}<>$TTY
>   exec {_Dbg_fd}<&-
>   exec {_Dbg_fd}>&-
> 
> bug.zsh:3: file descriptor 12 out of range, not closed. And ksh
> doesn't seem to complain.
> I gather that closing _Dbg_fd for input also closes it for output.
> 
> Is this the expected or okay?

Certainly expected by me: "close" means completely close the file
descriptor.  I think the only alternative (that would allow you to leave
it open for one of reading or writing after opening it for both) would
be to close it and reopen it, which is a larger side effect than I would
expect.  I'm happy to hear alternative interpretations, of course.

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