D
Darby Wong
The documentation for file() says that the buffer size will be:
system default if bufsize == -1,
unbuffered if bufsize == 0,
line buffered if bufsize == 1,
or else it is just bufsize.
I can't get this last one to work... if I write something like:
the file "testfile" is not written to... it only gets written to when
the buffer size reaches 4096 bytes, which is the system default from
what I can ascertain. It doesn't work if I set bufsize to be larger
than 4096 either, it will get written when it reaches 4096 bytes no
matter what.
Am I doing something wrong? Is this option not implemented all the
way (the -1,0,1 seem to work fine... except that 1 is also 4096 byte
buffered, in addition to being line buffered)?
Thanks
Darby
system default if bufsize == -1,
unbuffered if bufsize == 0,
line buffered if bufsize == 1,
or else it is just bufsize.
I can't get this last one to work... if I write something like:
the file "testfile" is not written to... it only gets written to when
the buffer size reaches 4096 bytes, which is the system default from
what I can ascertain. It doesn't work if I set bufsize to be larger
than 4096 either, it will get written when it reaches 4096 bytes no
matter what.
Am I doing something wrong? Is this option not implemented all the
way (the -1,0,1 seem to work fine... except that 1 is also 4096 byte
buffered, in addition to being line buffered)?
Thanks
Darby