1

I am having a bit of problem using cURL to download using FTP, that is to say I think it's being rather slow if working at all. I usually use wget an this one file which I downloaded earlier with wget started and finished under 10 minutes. The size was about 200 MB, a Linux distribution. I tried it later on with cURL, first time using it, and all I did was type in the FTP address after the cURL command as I would with wget. I started seeing the source code and everything, but it's been like an hour and it still hasn't finished, is this normal? My connection seems fine, as fast as it's supposed to be. I would appreciate if someone who uses cURL or knows about it extensively could explain the matter.

-

Currently using: Ubuntu 9.10/Windows 7, Crunchbang 9.04/Windows XP.

2
  • What's the exact command you used, what switches if any?
    – Marcin
    Jan 13, 2010 at 3:41
  • i did the same thing my first time using curl; it's just a different tool with different defaults, that's all. Jan 13, 2010 at 3:49

2 Answers 2

1

wget saves to a file by default; cURL by default outputs to STDOUT (meaning your screen). You need to specify that it should be outputting to a file. You can do this with the -o (aka --output) switch, or with shell redirection:

# switch to the curl command
curl ftp://someserver.com/path/to/file -o output.filename.here

# shell redirection
curl ftp://someserver.com/path/to/file > output.filename.here

The slowness probably is due more to the output going to the terminal screen than your network speed; once you redirect the output to a file you should see download speeds roughly equivalent to what you got with wget.

5
  • 1
    This sounds like the case. I'm sure we've all made this mistake at some point or another and had the terminal bark at us, +1 :)
    – user1931
    Jan 13, 2010 at 3:55
  • That's why in my comment I asked him what switches he used when he ran it ;)
    – Marcin
    Jan 13, 2010 at 4:19
  • @marcin: if you read closely, he already said he didn't use any switches: "all I did was type in the FTP address after the cURL command as I would with wget" Jan 13, 2010 at 4:22
  • Thanks, it was a stupid mistake on my part thinking it must work the same way as wget, should have read the manuals first. Jan 13, 2010 at 4:34
  • I guess he did, I must have missed it.
    – Marcin
    Jan 13, 2010 at 4:53
0

The reason you're seeing source code is probably because you haven't specified an output file as ~quack has mentioned.

I've never had speed issues with cURL via FTP, you may have also picked a bad server in terms of distance and speeds. Sometimes a site will provide a single download link that will actually dynamically pick you a mirror when you access it. You may have gotten a different, slower server the second time around.

3
  • bad server is possible, but i think it's more likely due to outputting to the terminal. remember terminal output speeds are on the order of analog POTS modems -- 9600 baud, 14400, etc. your TTY's baud rate is probably specified in /etc/inittab (if it's a real TTY; not sure where pseudo-TTYs are defined). Jan 13, 2010 at 3:54
  • Yeah that likely is the problem, it seems we were both commenting each other's answers at the same time! Just some alternate possibilities that may add to it.
    – user1931
    Jan 13, 2010 at 3:56
  • np. you're not wrong, i just took advantage of your answer to point out the actual term speeds. :) Jan 13, 2010 at 4:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .