Dennis Lee Bieber wrote:
On Mon, 27 Jul 2009 13:38:25 -0700 (PDT), erikcw
<erikwickst...@gmail.com> declaimed the following in
gmane.comp.python.general:
Something like the Python equivalent of curl http://url.com/file.xml |
head -c 2048
Presuming that | is a shell pipe operation, then doesn't that
command line use "curl" to download the entire file, and "head" to
display just the first 2k?
No, the entire file is not downloaded. My understanding of why this is (which
could be wrong) is that the output of curl is piped to head, and once head gets
the first 2k it closes the pipe. Then, when curl tries to write to the pipe
again, it gets sent the SIGPIPE signal at which point it exits.
Cheers,
Ben
--
http://mail.python.org/mailman/listinfo/python-list