このBlogは移転しました。今後は aish.dev を御覧ください。

2011-03-30から1日間の記事一覧

Pythonで学ぶ「詳解 UNIXプログラミング」(その12) 第12章 高度な入出力

12.1 ブロックしない大量のwrite import os, sys, fcntl buf = sys.stdin.read() print >>sys.stderr, "read {0} bytes".format(len(buf)) wrote = 0 fno = sys.stdout.fileno() val = fcntl.fcntl(fno, fcntl.F_GETFL, 0) fcntl.fcntl(fno, fcntl.F_SETFL, …