1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Do not modify this file since it was automatically generated from:
%
% downloadFile.R
%
% by the Rdoc compiler part of the R.oo package.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\name{downloadFile.character}
\alias{downloadFile.character}
\alias{downloadFile}
\title{Downloads a file}
\description{
Downloads a file.
}
\usage{
\method{downloadFile}{character}(url, filename=basename(url), path=NULL, skip=TRUE, overwrite=!skip, ...,
username=NULL, password=NULL, binary=TRUE, dropEmpty=TRUE, verbose=FALSE)
}
\arguments{
\item{url}{A \code{\link[base]{character}} string specifying the URL to be downloaded.}
\item{filename, path}{(optional) \code{\link[base]{character}} strings specifying the
local filename and the path of the downloaded file.}
\item{skip}{If \code{\link[base:logical]{TRUE}}, an already downloaded file is skipped.}
\item{overwrite}{If \code{\link[base:logical]{TRUE}}, an already downloaded file is overwritten,
otherwise an error is thrown.}
\item{...}{Additional arguments passed to \code{\link[utils]{download.file}}.}
\item{username, password}{\code{\link[base]{character}} strings specifying the username
and password for authenticated downloads. The alternative is to
specify these via the URL.}
\item{binary}{If \code{\link[base:logical]{TRUE}}, the file is downloaded exactly "as is", that is,
byte by byte (recommended).}
\item{dropEmpty}{If \code{\link[base:logical]{TRUE}} and the downloaded file is empty, the file
is ignored and \code{\link[base]{NULL}} is returned.}
\item{verbose}{A \code{\link[base]{logical}}, \code{\link[base]{integer}}, or a \code{\link{Verbose}} object.}
}
\value{
Returns the local pathname to the downloaded filename,
or \code{\link[base]{NULL}} if no file was downloaded.
}
\details{
Currently arguments \code{username} and \code{password} are only used
for downloads via URL protocol 'https'. The 'https' protocol requires
that either of 'curl' or 'wget' are available on the system.
}
\examples{\dontrun{
pathname <- downloadFile("https://www.r-project.org/index.html", path="www.r-project.org/")
print(pathname)
}}
\author{Henrik Bengtsson}
\seealso{
Internally \code{\link[utils]{download.file}} is used.
That function may generate an empty file if the URL is not available.
}
\keyword{methods}
\keyword{programming}
\keyword{file}
|