Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: stream buffering
- X-seq: zsh-users 15812
- From: Rory Mulvaney <rorymulv@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: stream buffering
- Date: Fri, 18 Feb 2011 17:56:10 -0600 (CST)
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:subject:in-reply-to:message-id :references:user-agent:mime-version:content-type; bh=7jTjnI68QRD0y6lQOwlOlX5QWYRIG7Epe2DC/jlny/E=; b=eeZac0JGGW+7S+sHrWp2aZgUqF6qo4ZdYVNG0VDSM0Bw2Vdgq7+wwoAycOCI805RSI ZSp3m3JGAnejGwSqJz0667PMbkmam4KyU7WyRRPSMdwfo5wwq/wbVE+MG6KPcS8/7pi7 II1zLRxWo+kI1tB3xYoem98UOJZeCHdLmeStw=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:in-reply-to:message-id:references:user-agent :mime-version:content-type; b=fmk/lADSD53rOF1oeTbimsLxWpUCusmdhMAt0J82m3JomNjaubMoVRM/h6EZHkufhJ 66eAaLU4pec9jNtm3Isg5GAIXB9WsMBXyoaUDK1t59Fe0E//QS0PkOkiuiruTAa6KghW n9VbIU5qtW7E+YriWSKyWNvQZxQ96T/dOKD7g=
- In-reply-to: <alpine.DEB.2.00.1102181746060.22551@MyComp.rgm-web.net>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <alpine.DEB.2.00.1102181746060.22551@MyComp.rgm-web.net>
On Fri, 18 Feb 2011, Peter Stephenson wrote:
> On Thu, 17 Feb 2011 19:40:20 -0600 (CST)
> Rory Mulvaney <rorymulv@xxxxxxxxx> wrote:
>
> > I'm wondering if the reason that some I/O intensive zsh shell scripts
> > aren't fast is mostly only because the I/O is (I think) line-buffered.
> > Is there a way to do full buffering of streams, or what would be the
> > best way to provide it? Maybe a module similar to zsh/net/socket,
> > perhaps using setvbuf(3)?
>
> What I/O are you referring to? The shell's own input for a script needs
> to be parsed and intepreted, which will be much more of a restriction than
> buffering except for scripts with really silly amounts of embedded text
> like here documents. Standard input to the shell via the read builtin
> etc. similarly tends to be in short chunks, likewise output via print.
> Input to other commands run from scripts makes its own arrangements for
> buffering.
Sorry, I'm definitely referring to the type of I/O using read and print
(or some other builtin created by a module). And I don't necessarily mean
in a script; it could just be from a loop on the command line where the
loop reads or prints all lines in a file.
while read var ; do
-something-
done
-Rory
[sorry if there are some incorrect threading headers, since I just
subscribed now]
Messages sorted by:
Reverse Date,
Date,
Thread,
Author