Best way to save file to disk using C++

SpoonTech

Well-Known Member
Joined
Jan 19, 2011
Messages
360
Reaction score
0
Hi,

If I have N url's in a text file. ie.
- http://www.server.com/doc1.pdf
- http://www.server.com/doc1023.pdf
- http://www.server.com/doc9.pdf

I want to now save these files to disk. (Linux).
For example, save them to /home/steve/home/pdfdocs/, i need this to happen via a script or a C++ program.
Can anyone advise a good way to do this (PseudoCode) OR does anyone know of a freeware app that can download a list of files like this (maybe automatically if I code these files in RSS feed??)..

Regards
 
Could probably read each line into a variable, then use wget to download the file from the URL. Not a *nix expert, I'm sure someone here can help you with the script details but that's how I'd do it.
 
Code:
while read line; do wget $line; done < file.txt

or something like that in bash
 
awesome will give it a go.. even if i use the wget commands in my c++ prog.. Didn't know you could implement while loops and such in .sh scripts
 
used wget, has a command to automatically download a text file filled with links =)
thanks
 
Top
Sign up to the MyBroadband newsletter
X