[R] FTP Download

Martin martin at bier-mail.de
Thu Sep 16 16:56:54 CEST 2010


Hi,

I have problems downloading complete folders via ftp with R. Single files
work fine.
I tried Rcurl, but it does not work.
This is my code:

url =
"ftp://disc2.nascom.nasa.gov/data/TRMM/Gridded/Derived_Products/3B42_V6/Daily/2009/"
filenames = getURL(url, ftp.use.epsv = FALSE, ftplistonly = TRUE, crlf =
TRUE)
filenames = paste(url, strsplit(filenames, "\r*\n")[[1]], sep = "")

no problems until here, I get a list with the files I want. But then, when I
use:
download.file(filenames, destfile="") I don't know how to tell R to use the
same names for the destfiles als the filenames.

If i use:
con = getCurlHandle( ftp.use.epsv = FALSE)
contents = sapply(filenames[1:5], getURL, curl = con)
names(contents) = filenames[1:length(contents)]

I get an "error in curlPerform".

I know, it's easy to download ftp folders with appropriate programs, but i
want to manage to get it work in R....

greets
Martin
-- 
View this message in context: http://r.789695.n4.nabble.com/FTP-Download-tp2542359p2542359.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list