Get remote URL directory listing
Usage
getUrlDirList(
url,
type = c("all", "dirs", "files"),
pattern = NULL,
absolute = FALSE
)Arguments
- url
character(1). Uniform Resource Locator (URL).- type
character(1). Type of files to return:"all": Both directories and files."dirs": Directories only."files": Files only.
- pattern
character(1). Regular expression pattern to use for matching. Only matches against the basename of the URL.- absolute
logical(1). Return absolute path.
Details
FTP and HTTP(S) servers are supported. Designed to be simple, and does not support recursive directory listing.
Examples
url <- "ftp://ftp.ncbi.nlm.nih.gov/genomes/"
if (goalie::isAnExistingUrl(url)) {
x <- getUrlDirList(url)
print(x)
}