No more fragmented downloads

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.

About emtee
I started to use DC using DC++ in 2003 when its version number was around 0.261. Since then I've been amazed by the DC network: a professional but still easy-to-use way of P2P file sharing. I was invited to the DC++ development team in 2006 where - in the beginning - I had been doing user support and testing only. A few years later I started to add small contributions to the DC++ code as well so these days I do mostly bug fixes, testing and improvements as well as I take part of the improvement of the documentation for both DC++ and ADCH++. I translated the whole DC++ help file to my native language (Hungarian) and currently maintaining the whole HU locale stuff for DC++. My ultimate goal is to help making the DC network as more user friendly as possible.

One Response to No more fragmented downloads

  1. lorddaimos says:

    Good thinking, antifrag should have been the only option a long time ago. What I would like to see however is an extension of the TAG sent out by the client saying if they have segmented downloading enabled or not. Right now I know of several hubs that blocks newer versions of DC++ because of the segmented downloading feature (slow users hogging slots on several users for ages when downloading a large file). Any chance of that being added in the near future? I would really like to upgrade to the new 7.x version.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: