Skip to content

Opening connection to FTP site

2 messages · michael watson (IAH-C), Brian Ripley

#
Hi

Is it possible to open a connection to an FTP site such that I can read
the directory listing?  Eg:

URL <- url("ftp://ftp.ensembl.org", open="r")
Error in url("ftp://ftp.ensembl.org", open="r") :
	unable to open connection

URL <- url("ftp://ftp.ensembl.org")
open(URL)
Error in open.connection(URL) : unable to open connection

I think perhaps it is because there isn't actually a file there to
connect to, eg this works fine:

URL <- url("ftp://ftp.ensembl.org/pub/README", open="r")

Thanks in advance

Mick
#
On Tue, 30 Nov 2004, michael watson (IAH-C) wrote:

            
It is not possible using url().  Try, e.g.

tmp <- tempfile()
download.file("ftp://ftp.ensembl.org", tmp, method="lynx") # or "wget"
readLines(tmp)