Thread: Downloading files (not sockets)

  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    45

    Downloading files (not sockets)

    I was wondering how to simply download files on Linux with C++, off the internet. I don't understand sockets too well, but from what I do understand your server needs to have support set up, and you only need sockets for input/output, not just output.


    Thanks.

  2. #2
    Registered User Joelito's Avatar
    Join Date
    Mar 2005
    Location
    Tijuana, BC, México
    Posts
    310
    curl, make a front-end to wget, yep we got options.
    * PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with xfce4.
    * Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with xfce4.

  3. #3
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by Muscovy View Post
    I was wondering how to simply download files on Linux with C++, off the internet. I don't understand sockets too well, but from what I do understand your server needs to have support set up, and you only need sockets for input/output, not just output.
    Hmm. Well, most people would consider downloading input. Except that you may want to download something specific, other than random space dust, so that will mean asking for it! Sending a "request", as it were! That will be the "output"!

    In other words, you do need input/output for this. However, this idea that "your server needs to have support set up" is not so well thought out. Consider: you have a web browser, and obviously your web browser is capable of downloading. Does it do this via sockets? Yes! Does it require some kind of special arrangement with "your server" that does not already exist? No!
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  4. #4
    {Jaxom,Imriel,Liam}'s Dad Kennedy's Avatar
    Join Date
    Aug 2006
    Location
    Alabama
    Posts
    1,065
    Quote Originally Posted by Joelito View Post
    curl, make a front-end to wget, yep we got options.
    You don't even have to make a front-end. I think (it has been a while) that one can compile wget as a library and statically link to it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Error opening files in a different dir
    By Ozzie in forum C++ Programming
    Replies: 3
    Last Post: 10-09-2008, 06:55 AM
  2. Working with muliple source files
    By Swarvy in forum C++ Programming
    Replies: 1
    Last Post: 10-02-2008, 08:36 AM
  3. Batch file programming
    By year2038bug in forum Tech Board
    Replies: 10
    Last Post: 09-05-2005, 03:30 PM
  4. Downloading files
    By johnchain in forum C Programming
    Replies: 24
    Last Post: 08-15-2005, 11:17 PM
  5. reinserting htm files into chm help files
    By verb in forum Windows Programming
    Replies: 0
    Last Post: 02-15-2002, 09:35 AM