Please, can anyone explain me the meaning of the "buffering > 1" in the built-in open()? The doc says: "...and an integer > 1 to indicate the size of a fixed-size chunk buffer." So I thought this size was the number of bytes or chars, but it is not:
>>> f = open('myfile', 'w', buffering=2) >>> f.write('a') 1 >>> open('myfile').read() '' >>> f.write('b') 1 >>> open('myfile').read() '' >>> f.write('cdefghi\n') 8 >>> open('myfile').read() '' >>> f.flush() >>> open('myfile').read() 'abcdefghi\n' Regards, Marco -- http://mail.python.org/mailman/listinfo/python-list