inst/examples/ftpList.R

library(RCurl)
url = "ftp://ftp.wwpdb.org/pub/pdb/data/structures/all/pdb/"
fileNames = getURL(url, .opts = list(customrequest = "NLST *.gz") )
fileNames = strsplit(fileNames, "\\\r\\\n")[[1]]

# Now you can download these directly but you have to deal
# with the compression. This is possible with RCurl by
# specifying a binary reader.

# Alternatively, get the entiore directory listing and have to pull
# the names out of this much bigger download.
z = getURL(url, .opts = list(customrequest = "LIST *.gz") )

Try the RCurl package in your browser

Any scripts or data that you put into this service are public.

RCurl documentation built on Nov. 3, 2023, 1:09 a.m.