Monday, 12 December 2005

High Speed Downloads

I wanted to download NeoOffice today, an OS-X office suite based on OpenOffice.org. The package file is 107 megabytes so there was plenty of opportunity for the download to get cancelled. This is where I discovered curl. I suppose this tool is available on Linux and other variants of UNIX so *nix gurus who know about it, you can stop reading now.

curl is a command line download tool that is full of useful options. The simplest way to use it is to trigger a resumable download. The easiest way to do this is to issue the command curl -C - -O remote-file. The -C - option tells curl to resume the download where it was previously stopped. So if the download is interrupted for any reason, rerun the same command and it will find where to pick up from. The -O options tells it to store the file locally with the same name as the remote file. You can specify a different file name with the -o option of you wish.

This is the basics but curl is much more complex than that. In particular, it can download a series of file that follow a logical numeric or alphabetic sequence. It can also use multiple threads to speed up download. The best thing is to type man curl to have a look at what it can do.

Does it work and how fast is it then? You bet it does: it took me 10 minutes and 36 seconds to download the 107 megabytes of NeoOffice over a 2Mb broadband connection, which amounts to curl using 2/3 of the bandwidth, thus being fast but still letting me surf the net at the same time. Nice toy.