[R] Listing the contents of an FTP directory via R?

Jonathan Greenberg jgrn at illinois.edu
Mon Apr 9 20:48:53 CEST 2012


It seems to be choking on NLST:

require("RCurl")
getURL("ftp://e4ftl01.cr.usgs.gov/MOTA/MCD15A3.005/",verbose=TRUE,ftp.use.epsv=TRUE,
dirlistonly = TRUE)

...

< 230 Guest login ok, access restrictions apply.
> PWD
< 257 "/" is current directory.
* Entry path is '/'
> CWD MOTA
< 250 CWD command successful.
> CWD MCD15A3.005
< 250 CWD command successful.
> EPSV
* Connect data stream passively
< 500 'EPSV': command not understood.
* disabling EPSV usage
> PASV
< 227 Entering Passive Mode (152,61,133,5,177,17)
*   Trying 152.61.133.5... * connected
* Connecting to 152.61.133.5 (152.61.133.5) port 45329
> TYPE A
< 200 Type set to A.
> NLST
< 550 No files found.
* RETR response: 550
* Remembering we are in dir "MOTA/MCD15A3.005/"
* Connection #0 to host e4ftl01.cr.usgs.gov left intact
Error in function (type, msg, asError = TRUE)  : RETR response: 550

Thanks for looking into this!

--j

On Mon, Apr 9, 2012 at 1:45 PM, steven mosher <moshersteven at gmail.com> wrote:
> Ya I hit the same error with my code that reads directories.
> I'll try some other stuff . I think I hit this error before I  with usgs.
>
>
> On Mon, Apr 9, 2012 at 11:40 AM, Jonathan Greenberg <jgrn at illinois.edu>
> wrote:
>>
>> Steven:
>>
>> Thanks -- I seem to be running into the problem with the link I sent
>> along:
>>
>> >
>> > getURL("ftp://e4ftl01.cr.usgs.gov/MOTA/MCD15A3.005/",verbose=TRUE,dirlistonly
>> > = TRUE)
>> Error in function (type, msg, asError = TRUE)  : RETR response: 550
>>
>> I'm wondering if it might be a passive ftp issue, but:
>> >
>> > getURL("ftp://e4ftl01.cr.usgs.gov/MOTA/MCD15A3.005/",verbose=TRUE,ftp.use.epsv=TRUE,
>> > dirlistonly = TRUE)
>> Error in function (type, msg, asError = TRUE)  :
>>  FTP response reading failed
>>
>> Does not seem to work...  Thoughts?
>>
>> --j
>>
>> On Mon, Apr 9, 2012 at 1:32 PM, steven mosher <moshersteven at gmail.com>
>> wrote:
>> > A couple of ways.
>> >
>> > using Rcurl   you can use the  curlOption of dirlistonly.
>> >
>> > otherwise you can read the page and parse.  I've got some code around
>> > here
>> > to do that.
>> >
>> > Steve
>> >
>> > On Mon, Apr 9, 2012 at 11:27 AM, Jonathan Greenberg <jgrn at illinois.edu>
>> > wrote:
>> >>
>> >> R-helpers:
>> >>
>> >> I'd like to be able to store all the file information from an ftp site
>> >> (e.g. file and foldernames) through an R command.  Any ideas how to do
>> >> this?  Here's an example site to use:
>> >>
>> >> ftp://e4ftl01.cr.usgs.gov/MOTA/MCD15A3.005
>> >>
>> >> --j
>> >>
>> >> --
>> >> Jonathan A. Greenberg, PhD
>> >> Assistant Professor
>> >> Department of Geography and Geographic Information Science
>> >> University of Illinois at Urbana-Champaign
>> >> 607 South Mathews Avenue, MC 150
>> >> Urbana, IL 61801
>> >> Phone: 415-763-5476
>> >> AIM: jgrn307, MSN: jgrn307 at hotmail.com, Gchat: jgrn307, Skype: jgrn3007
>> >> http://www.geog.illinois.edu/people/JonathanGreenberg.html
>> >>
>> >> ______________________________________________
>> >> R-help at r-project.org mailing list
>> >> https://stat.ethz.ch/mailman/listinfo/r-help
>> >> PLEASE do read the posting guide
>> >> http://www.R-project.org/posting-guide.html
>> >> and provide commented, minimal, self-contained, reproducible code.
>> >
>> >
>>
>>
>>
>> --
>> Jonathan A. Greenberg, PhD
>> Assistant Professor
>> Department of Geography and Geographic Information Science
>> University of Illinois at Urbana-Champaign
>> 607 South Mathews Avenue, MC 150
>> Urbana, IL 61801
>> Phone: 415-763-5476
>> AIM: jgrn307, MSN: jgrn307 at hotmail.com, Gchat: jgrn307, Skype: jgrn3007
>> http://www.geog.illinois.edu/people/JonathanGreenberg.html
>
>



-- 
Jonathan A. Greenberg, PhD
Assistant Professor
Department of Geography and Geographic Information Science
University of Illinois at Urbana-Champaign
607 South Mathews Avenue, MC 150
Urbana, IL 61801
Phone: 415-763-5476
AIM: jgrn307, MSN: jgrn307 at hotmail.com, Gchat: jgrn307, Skype: jgrn3007
http://www.geog.illinois.edu/people/JonathanGreenberg.html



More information about the R-help mailing list