[arch-general] broken pipe

mar77i at protonmail.ch mar77i at protonmail.ch
Wed Dec 18 15:52:36 UTC 2019


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Wednesday, December 18, 2019 4:41 PM, Andy Pieters <arch-general at andypieters.me.uk> wrote:

> On Wed, 18 Dec 2019 at 15:32, Pascal via arch-general
> arch-general at archlinux.org wrote:
>
> > that's awesome, it works !
> > it was so simple with cat taking over and consuming the data until the end !
> > (I added a redirect to /dev/null to cat)
> > big thank you.
>
> I'm interested in the amount of effort you put into this. Isn't the
> overhead of the pipes etc going to negate any memory/speed
> improvements you may get from only opening the file once or is there
> another consideration at play here?

IMHO, reading from memory is generally preferable to reading again from disk, that is, assuming a "worse" solution that would rely on multiple reads. It makes sure the data is actually the same data is transmitted and no other process writes to the file meanwhile. It's also easier to do than fiddling with flock() and the like. Also I'd advise against reading binary data into environment variables, which I think is what the approach with tee is supposed to solve, therefore I really like it. Technically you should be able to tee yourself into a full set of http headers.

cheers!
mar77i


Sent with ProtonMail Secure Email.


More information about the arch-general mailing list