Dear List,
I'm looking for a function for listening of the content witin a ftp server.
I need to list bevor I download a file becaus I don't know the exat names of
a file or dirs. Up to now I'm using the "getURL" function from
RCurl package. But it relativly often happens that I get a errorcode 550 an
I'm not able to get the information. If I put the very same adress to a
browser I get te content, so the connection is working.
Thanks in advance Matteo
####
library(RCurl)
filelisturl <-
"ftp://e4ftl01.cr.usgs.gov/MOLT/MOD13Q1.005/2000.02.18"
dirlisturl <- "ftp://e4ftl01.cr.usgs.gov/MOLT/MOD13Q1.005/"
getURL(filelisturl) # sometimes it works but if not I get this error: Error in
function (type, msg, asError = TRUE) : RETR response: 550
getURL(dirlisturl) # dir list has less problems than filelist but it is not
reliable too
####
####
#Since I have to connect only to a few number or ftp sterver, I have tried to
use url() to open the connection and read the content(names). But I'm not
able to open the connection...
####
d<- url(filelisturl)
open(d)
c <- url(dirlisturl)
open(c)
#####
sessionInfo()
R version 2.14.2 (2012-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=C LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] mapdata_2.2-1 maps_2.2-5 MODIS_0.3-1 raster_1.9-72
[5] sp_0.9-97 SSOAP_0.9-0 XMLSchema_0.7-0 XML_3.93-0
[9] RCurl_1.91-1 bitops_1.0-4.1
loaded via a namespace (and not attached):
[1] codetools_0.2-8 grid_2.14.2 lattice_0.20-3 tools_2.14.2
>
[[alternative HTML version deleted]]