On Wed, Jul 15, 2009 at 03:08:41PM -0700, Brock Pytlik wrote: > Webrev: > http://cr.opensolaris.org/~bpytlik/ips-10050-v1/ > > Bug: > reading manifests during search should pick an appropriate buffer size > http://defect.opensolaris.org/bz/show_bug.cgi?id=10050
Stupid question: What was the rationale for the choice of 512 bytes? Here's the relevant pydoc for open(): open = class file(object) | file(name[, mode[, buffering]]) -> file object | | Open a file. The mode can be 'r', 'w' or 'a' for reading (default), | writing or appending. The file will be created if it doesn't exist | when opened for writing or appending; it will be truncated when | opened for writing. Add a 'b' to the mode for binary files. | Add a '+' to the mode to allow simultaneous reading and writing. | If the buffering argument is given, 0 means unbuffered, 1 means line | buffered, and larger numbers specify the buffer size. I may have misunderstood, but if you're just reading a line then you probably want set buffering to line buffering (1). Also, you don't seem to be supplying any mode arguments to open(), "rb" is usually customary for reading files. Do you perform any other operations other than reading a line out of the file here? -j _______________________________________________ pkg-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
