Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: exec {_Dbg_new_fd}<>&-
- X-seq: zsh-workers 26134
- From: Peter Stephenson <pws@xxxxxxx>
- To: "Zsh hackers list" <zsh-workers@xxxxxxxxxx>
- Subject: Re: exec {_Dbg_new_fd}<>&-
- Date: Fri, 12 Dec 2008 09:47:51 +0000
- In-reply-to: <6cd6de210812111709l43863baatc4eb728035b8f1f1@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <6cd6de210812111709l43863baatc4eb728035b8f1f1@xxxxxxxxxxxxxx>
"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