From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: Do file descriptors survive to subshell?
Date: Mon, 12 Sep 2016 11:24:51 -0700 [thread overview]
Message-ID: <160912112451.ZM25357@torch.brasslantern.com> (raw)
In-Reply-To: <CAKc7PVCXG-4D4cJ_Hb849pawBtgx3mE3Rx71JSvjeY2gty8bAg@mail.gmail.com>
On Sep 12, 6:29pm, Sebastian Gniazdowski wrote:
}
} BTW., read -t -u seems to succeed as many times as there are lines in
} a file (file descriptor), that's rather unexpected, it rather should
} do some "read char, put char back" thing, or something not changing FD
} position in file I would say
?? 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.
next prev parent reply other threads:[~2016-09-12 18:33 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 [this message]
2016-09-13 8:54 ` Sebastian Gniazdowski
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=160912112451.ZM25357@torch.brasslantern.com \
--to=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).