This will download a file, if retry is set and 404 is returned it will wait until the file is available. If the file is still not available after timeout tries, it will return NA. If the file is downloaded it will return the name of the file

download.url(url, file, timeout = 600, .opts = list(), retry = TRUE)

Arguments

url

the url of the file to download

file

the filename

timeout

number of seconds to wait for file (default 600)

.opts

list of options for curl, for example to download from a protected site use list(userpwd=userpass, httpauth = 1L)

retry

retry if url not found yet, this is used by Brown Dog

Value

returns name of file if successful or NA if not.

Examples

if (FALSE) { # \dontrun{
download.url('http://localhost/', index.html)
} # }