Quantcast
Channel: How big is the pipe buffer? - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 10

Answer by unhammer for How big is the pipe buffer?

$
0
0

If you need the value in Python>=3.3, here's a simple method (assuming you can run call out to dd):

from subprocess import Popen, PIPE, TimeoutExpired
p = Popen(["dd", "if=/dev/zero", "bs=1"], stdin=PIPE, stdout=PIPE)
try: 
    p.wait(timeout=1)
except TimeoutExpired: 
    p.kill()
    print(len(p.stdout.read()))

Viewing all articles
Browse latest Browse all 10

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>