Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
connecting to ftp sites and download certain files based on file extensionsby Anonymous Monk |
on Oct 06, 2006 at 13:45 UTC ( [id://576663]=perlquestion: print w/replies, xml ) | Need Help?? |
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hello monks! I am new to Perl and I don't know what I can do to solve the following problem: I want to contact an ftp site (namely:ftp://ftp.ncbi.nih.gov/genomes/Bacteria) and download locally all the subfolders in it, but downloading only files with the extension .faa). For example, I want to download tha folder Bacteria (as I wrote previously) and then, recursively, download all subfolders (like Acidobacteria_bacterium_Ellin345) and only the files with extension .faa (like NC_008009.faa which is inside the Acidobacteria_bacterium_Ellin345 folder). I thought of downloading the whole ftp folder with wget -r command of Linux, but the files are rather large and will take sometime. I believe I must store all the names of the folders in a list and then open each folder and apply wget only to the files with .faa extension. I have no idea how I contact with ftp sites using Perl though... Any hints would be grately appreciated...
Back to
Seekers of Perl Wisdom
|
|