Re: [libtorrent] storage allocation issues
Brought to you by:
arvidn
From: Arvid N. <ar...@cs...> - 2008-09-17 08:54:07
|
Sergei Vorobyov wrote: > Hello, > I have some questions about storage allocation modes in libtorrent. > > 1. Relative documentation in the "storage allocation" section: > ... > 2. The compact allocation mode, where only files are allocated > for actual pieces that have been downloaded. This is the default > allocation mode in libtorrent. > 3. The sparce allocation, sparse files are used, and pieces > are downloaded directly to where they belong. This is the recommended > (and default) mode. > in the trunk, storage allocation mode is "storage_mode_sparse" by > default, but documentation is not clear (both default). > Fixed in trunk, thanks! The sparse allocation is the default. > 2. When I set the storage allocation mode to storage_mode_compact, it > works strange: > Torrent with two files (one big "iso" file and second a little > "txt" file). Set priority of "iso" file to zero, to prevent it from > downloading, only little "txt" expected to be downloaded. Starting the > torrent. After downloading completes, I have full sized empty "iso" > file, and body of "txt" file within. No single "txt" file. Downloading > the same torrent in storage_mode_sparse place two files in output > directory - completed "txt", and "iso", whole zeroed (almost). > > The torrent I mention is > http://torrent.fedoraproject.org/torrents/Fedora-9-i686-Live-KDE.torrent > > There a bug with storage allocations? And how can I prevent from > downloading (or allocating full size) "iso" file if I want to download > only one little file from the torrent? > Currently the answer is to use sparse files. The ending of the iso file still needs to be stored somewhere, and if the file is sparse, it shouldn't matter. In order to make it appear nicer in the filesystem, you can rename the file to .parts/<file-index> or something, in order to put all the deselected files in a separate part file directory. see torrent_handle::rename_file() -- Arvid Norberg |