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

Re: reopening/resetting/tee'ing pipes?



A pipe is a FIFO -- first in first out. It is not a file. Once you consume the input it is gone. You can't rewind it. This has nothing to do with zsh and its <() syntax. It's a characteristic of UNIX pipes. It wouldn't matter if you wrote the script in another language.

Also, pipes generally have an upper bound on the amount of data they can buffer. Which means that once the buffer is full the producer (the "echo foo" in your example) will block when the buffer becomes full until some of the data is drained (the "cat $1" in your example). Which creates a practical limit even if you could somehow "reset" (by which I assume you mean rewind) the pipe.

On Aug 8, 2011, at 18:49 , Aaron Davies wrote:

> gmail.com



Messages sorted by: Reverse Date, Date, Thread, Author