Skip to content

Instantly share code, notes, and snippets.

@teepark
Created November 20, 2014 22:59
Show Gist options
  • Save teepark/ceca8f4020d99b7c8493 to your computer and use it in GitHub Desktop.
Save teepark/ceca8f4020d99b7c8493 to your computer and use it in GitHub Desktop.
def read_all(fd):
t = []
while 1:
x = os.read(fd, 4096)
if not x:
return ''.join(t)
t.append(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment