No more fragmented downloads
July 16, 2008 1 Comment
It has already described in a previous post that how downloads work in DC++ and how the temporary files created and copied to the target path when a download finished. That post mentions two kind of possible methods of allocating the necessary disk space during a download :
- the “normal” method where disk space allocated continuously as the file being downloaded (more precisely when a particular amount of data – the size of the download buffer – is received);
- and the so called anti-fragmentation method which allocates the whole required disk space for the file before the actual download starts.
According to the DC++ changelog, the possibility of anti-fragmented downloads is added way back in version 0.241. Both methods has advantages and disadvantages : the normal method requires less disk space until the download has been finished but the file can be fragmented and it also can make the whole filesystem fragmented soon. With trying to allocate all the required space in one go, antifragmentation method result files laid on the disk more continuously. Also when the files moved or deleted later, there will be more long contiguous regions of free space left in the file system.
Besides the less fragmented file/file system, anti-fragmentation method has more advantages :
- It speeds up downloads (especially when downloading large chunks in high speed transfers);
- Downloads won’t stop because of a disk full error any more – if there’s not enough space they won’t start at all.
Up until the recent versions of DC++ it was the users’ choice what method to use as both of them worked well before segmented downloads introduced in DC++.
If you examine the recent lines of the changelog you will find an entry for version 0.706 saying ”Anti-frag no longer optional – not using it was broken by segmented downloading”. That means the anti-fragmentation method is mandatory from this version, due to the implementation of segmented downloads.
As we said before the only disadvantage of the anti-fragmented method is that it needs more free disk space for the temporary files. This can be some bad news for those DC users who often suffer from lack of disk space. From now, they should take more care of adding large number of files to the download queue. Many of you who use other p2p software should be familiar with this kind of behaviour though, as almost all of them work the very same way.
There is trick that may help to avoid this higher chance of running out of disk space. Its useful for those who have more than one hard disk/partition in their computer. From the DC++ built-in Help :
You can use %[targetdrive] for optional unfinished directory for all target drives. This way you can share the incomplete files among your drives which will result a smaller chance of running out of disk space.
Example : when %[targetdrive]DCUnfinished\ set as unfinished directory, DC++ will create incomplete files in E:\DCUnfinished\ when you download to any target folder located on drive E: and so on…
%[targetrive] option is also useful if you often download larger files to a drive other than where your usual unfinished directory resides. At the end of a successful download, moving a large file from the unfinished folder to its target could be very time and resource consuming, especially when moving files to another partition of the same physical drive.
Also good to know that with anti-fragmented download method, users may face a confusing error message “Could not open target file : Not enough space on the disk” more often. This error can happen only at the start of a download only and it means that the temporary file couldn’t be created. This can cause some confusion for those who isn’t familiar with the way DC++ download files. Unfortunately this is a general error message and it hints that there’s a problem with the target disk space. If the unfinished folder and the download target is not in the same drive this message can appear even if there are plenty of space in the target disk.
The last change is that as of DC++ 0.707 the name of the temporary file omits the .antifrag extension. Why? Because its unnecessary. We know that all of them are anti-fragmented and they always look like filename.ext.TTH.dctmp from now.