Skip to content

Commit

Permalink
Report result code for each URL when downloading files simultaneously…
Browse files Browse the repository at this point in the history
… via

download.file().  Limit the number of concurrently open files and concurrent
downloads.


git-svn-id: https://svn.r-project.org/R/trunk@87084 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
kalibera committed Sep 2, 2024
1 parent 982288a commit fa691d7
Show file tree
Hide file tree
Showing 2 changed files with 305 additions and 149 deletions.
9 changes: 7 additions & 2 deletions src/library/utils/man/download.file.Rd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% File src/library/utils/man/download.file.Rd
% Part of the R package, https://www.R-project.org
% Copyright 1995-2022 R Core Team
% Copyright 1995-2024 R Core Team
% Distributed under GPL 2 or later

\name{download.file}
Expand Down Expand Up @@ -274,7 +274,12 @@ download.file(url, destfile, method, quiet = FALSE, mode = "w",
An (invisible) integer code, \code{0} for success and non-zero for
failure. For the \code{"wget"} and \code{"curl"} methods this is the
status code returned by the external program. The \code{"internal"}
method can return \code{1}, but will in most cases throw an error.
method can return \code{1}, but will in most cases throw an error. When
simultaneously downloading two or more files (see the \code{url} argument)
and download of at least one file succeeds, \code{0} is returned with
attribute \code{retvals}, which provides an integer vector of the same
length as \code{url} with a result code for each file (\code{0} for
success and non-zero for failure).

What happens to the destination file(s) in the case of error depends
on the method and \R{} version. Currently the \code{"internal"},
Expand Down
Loading

0 comments on commit fa691d7

Please sign in to comment.