BundleReader, Containers, and file IO

Aaron Bentley aaron.bentley at utoronto.ca
Thu Oct 25 15:59:26 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andrew Bennetts wrote:
> Aaron Bentley wrote:
>> Andrew Bennetts wrote:
>>> However, I'm not sure that for bundles we actually care about the requirement
>>> that we never over-read; as far as I can tell, that code is just used with real
>>> files that simply return '' when there are no more bytes available.
>>> So, is this approach reasonable?
>> I want to agree, but I do think it's reasonable to accept bundles from a
>> pipe.  Can we support that still?
> 
> It is, but it requires effort.

I think what happens with pipes is that when you over-read, you get a
short read.  Then the next time you read, you get an IO error.  That's
how my Linux behaves anyhow.  If that behavior is cross-platform, we
should be fine.

> And of course there's the option to just maintain two largely independent
> implementations: the existing blocking “pull-style” ContainerReader, and the
> “push-style” ContainerPushParser.  This perhaps makes good sense; pull-style is
> more convenient for certain tasks and certain optimisations (e.g. implementing a
> reader that only reads record headers and fseeks over the bodies).

We don't seem to have working pipe support at the moment anyhow, so I
wouldn't want to spend so much effort on it.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHIK9O0F+nu1YWqI0RApIhAJ43EZHJq9cPkxEJaE0TuUGpla6umACeNjHs
DMhbvDDCXYx85YoxOPoEZSM=
=z9Fa
-----END PGP SIGNATURE-----



More information about the bazaar mailing list