[tahoe-dev] File seeks

Brian Warner warner at lothar.com
Mon Jul 26 02:05:57 UTC 2010


On 7/25/10 5:09 PM, slush wrote:
> 
> is there any way how to download, say, second half of large file
> without downloading first half? Is that even teoritically possible in
> current implementation (can I decode file from any position)?

Yes and no. We carefully designed the file-encoding scheme to make
random access like this fast and easy. However we didn't implement full
support in the client right away.

The downloader in 1.7.1 will respond to partial-read requests (expressed
by passing a "Range:" header in your HTTP GET request) by downloading
the whole file to a temporary directory, and then passing you just the
range you cared about. If you request the first half of the file, it
will give you that data as soon as it becomes available, so you wouldn't
even notice an extra delay. But if you request the last half of the
file, it has to download the whole thing before it gives you any data at
all.

The new downloader that I'm almost finished with (see ticket #798 for
details) fixes this: if you ask for the last half of the file, it will
download only that half. The new downloader does not use cache files or
temporary directories.

If you'd like to try it out, apply the latest patch form #798 and give
it a spin.. I'm looking for feedback! It should work faster than the old
downloader too (fewer roundtrips, although obviously the overall
download rate for large files will remain the same).

cheers,
 -Brian


More information about the tahoe-dev mailing list