Pythonで私は書くことができます
content = open(filename, 'r').read()
ファイル全体をcontent
変数に読み込みます。ただし、Python 2.7.5 を搭載した私の Windows マシンでは、一部の大きなファイルに対して 255 バイトしか読み取れません。file.read のドキュメントをよく見ると、ファイル全体がブロック モードで読み込まれることしか期待できないことがわかります。ブロック モードを有効にして、ファイル全体が読み取られるようにするにはどうすればよいですか?
read(...)
read([size]) -> read at most size bytes, returned as a string.
If the size argument is negative or omitted, read until EOF is reached.
Notice that when in non-blocking mode, less data than what was requested
may be returned, even if no size parameter was given.