From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: Do file descriptors survive to subshell?
Date: Tue, 13 Sep 2016 10:54:12 +0200 [thread overview]
Message-ID: <CAKc7PVBcj=uV-9iv_2QHLBmQLwZ8J7-VC+5FuO8qb4vEywTdHw@mail.gmail.com> (raw)
In-Reply-To: <160912112451.ZM25357@torch.brasslantern.com>
On 12 September 2016 at 20:24, Bart Schaefer <schaefer@brasslantern.com> wrote:
> ?? That's not how "read" is defined. It either reads a line if it can,
> or it returns failure if it can't. The -t option only changes what
> "it can't" means, and the -u option only changes where it reads it.
> You can change how "a line" is defined, but you can't define "a line"
> as nothing.
>
> You might suggest that -k 0 should test whether reading is possible and
> return success without actually reading anything, but as currently
> defined "read" returns nonzero only when bytes are consumed.
That's quite regretful, how to check if a read descriptor is valid? To
test if a descriptor is inherited from previous Zsh execution I
switched to write descriptors and use print -u $EXPORTED_FD -n to test
them, this works.
Best regards,
Sebastian Gniazdowski
next prev parent reply other threads:[~2016-09-13 16:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20160912160148eucas1p1c7f423821260c611c9b34fbe47bfcf86@eucas1p1.samsung.com>
2016-09-12 15:29 ` Sebastian Gniazdowski
2016-09-12 16:19 ` Peter Stephenson
2016-09-12 16:29 ` Sebastian Gniazdowski
2016-09-12 18:24 ` Bart Schaefer
2016-09-13 8:54 ` Sebastian Gniazdowski [this message]
2016-09-14 17:53 ` Bart Schaefer
2016-09-15 6:41 ` Sebastian Gniazdowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAKc7PVBcj=uV-9iv_2QHLBmQLwZ8J7-VC+5FuO8qb4vEywTdHw@mail.gmail.com' \
--to=sgniazdowski@gmail.com \
--cc=schaefer@brasslantern.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).