Skip to content

Commit e14a1ec

Browse files
author
ripley
committed
tweaks after adding zstd support
git-svn-id: https://svn.r-project.org/R/trunk@87616 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 6e6f6ba commit e14a1ec

File tree

5 files changed

+25
-18
lines changed

5 files changed

+25
-18
lines changed

src/library/base/man/memCompress.Rd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% File src/library/base/man/memCompress.Rd
22
% Part of the R package, https://www.R-project.org
3-
% Copyright 2009-2023 R Core Team
3+
% Copyright 2009-2025 R Core Team
44
% Distributed under GPL 2 or later
55

66
\name{memCompress}
@@ -56,9 +56,9 @@ memDecompress(from,
5656
\eqn{2^{31}-1}{2^31 - 1} elements. Compression is equivalent to
5757
\command{bzip2 -9} (the default).
5858

59-
\command{zstd} compression is optional and currently uses compression
60-
level 3 which gives a good compression ratio vs compression speed
61-
trade-off.
59+
\command{zstd} compression was introduced in \R 4.5.0: it is an
60+
optional part of the \R build and currently uses compression level 3
61+
which gives a good compression ratio vs compression speed trade-off.
6262

6363
Compressing with \code{type = "xz"} is equivalent to compressing a
6464
file with \command{xz -9e} (including adding the \sQuote{magic}

src/library/base/man/readRDS.Rd

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% File src/library/base/man/serialize.Rd
22
% Part of the R package, https://www.R-project.org
3-
% Copyright 1995-2021 R Core Team
3+
% Copyright 1995-2025 R Core Team
44
% Distributed under GPL 2 or later
55

66
\name{readRDS}
@@ -20,18 +20,18 @@ infoRDS(file)
2020
}
2121
\arguments{
2222
\item{object}{\R object to serialize.}
23-
\item{file}{a \link{connection} or the name of the file where the \R object
24-
is saved to or read from.}
23+
\item{file}{a \link{connection} or the path name of the file where the
24+
\R object is saved to or read from.}
2525
\item{ascii}{a logical. If \code{TRUE} or \code{NA}, an ASCII
2626
representation is written; otherwise (default), a binary one is used.
2727
See the comments in the help for \code{\link{save}}.}
2828
\item{version}{the workspace format version to use. \code{NULL}
29-
specifies the current default version (3). The only other supported
29+
specifies the current default version (3). The only other supported
3030
value is 2, the default from \R 1.4.0 to \R 3.5.0.}
3131
\item{compress}{a logical specifying whether saving to a named file is
3232
to use \code{"gzip"} compression, or one of \code{"gzip"},
33-
\code{"bzip2"} or \code{"xz"} to indicate the type of compression to
34-
be used. Ignored if \code{file} is a connection.}
33+
\code{"bzip2"}, \code{"xz"} or \code{"zstd"} to indicate the type of
34+
compression to be used. Ignored if \code{file} is a connection.}
3535
\item{refhook}{a hook function for handling reference objects.}
3636
}
3737
\details{
@@ -97,6 +97,9 @@ infoRDS(file)
9797
machines, for example to download from a website. The
9898
files produced by \code{\link{save}} have a header identifying the
9999
file type and so are better protected against erroneous use.
100+
101+
\code{compress = "zstd"} was first supported in \R 4.5.0, and needs OS
102+
support so is even less suited as an interchange format.
100103
}
101104

102105
\seealso{

src/library/base/man/save.Rd

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% File src/library/base/man/save.Rd
22
% Part of the R package, https://www.R-project.org
3-
% Copyright 1995-2020 R Core Team
3+
% Copyright 1995-2025 R Core Team
44
% Distributed under GPL 2 or later
55

66
\name{save}
@@ -50,7 +50,7 @@ save.image(file = ".RData", version = NULL, ascii = FALSE,
5050
\item{compress}{logical or character string specifying whether saving
5151
to a named file is to use compression. \code{TRUE} corresponds to
5252
\command{gzip} compression, and character strings \code{"gzip"},
53-
\code{"bzip2"} or \code{"xz"} specify the type of
53+
\code{"bzip2"}, \code{"xz"} or \code{"zstd"} specify the type of
5454
compression. Ignored when \code{file} is a connection and
5555
for workspace format version 1.}
5656
\item{compression_level}{integer: the level of compression to be
@@ -180,12 +180,16 @@ save.image(file = ".RData", version = NULL, ascii = FALSE,
180180
vectors, external pointers and some S4 objects).
181181

182182
One such \sQuote{later addition} was \link{long vectors}, introduced in \R
183-
3.0.0 and loadable only on 64-bit platforms.
183+
3.0.0 and loadable only on 64-bit platforms (32-bit platforms are
184+
dperecated but still supported).
184185

185186
Loading files saved with \code{ASCII = NA} requires a C99-compliant C
186-
function \code{sscanf}: this is a problem on Windows, first worked
187+
function \code{sscanf}: this was a problem on Windows, first worked
187188
around in \R 3.1.2: version-2 files in that format should be readable
188189
in earlier versions of \R on all other platforms.
190+
191+
\code{compress = "zstd"} was first supported in \R 4.5.0 and needs
192+
(optional) OS support so is not recommended as an interchange format.
189193
}
190194
\seealso{
191195
\code{\link{dput}}, \code{\link{dump}}, \code{\link{load}},

src/library/tools/man/writePACKAGES.Rd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ write_PACKAGES(dir = ".", fields = NULL,
4040
are used.
4141
}
4242
\item{type}{
43-
Type of packages: currently source \file{.tar.\{gz,bz2,xz\}} archives,
43+
Type of packages: currently source \file{.tar.\{gz,bz2,xz,zstd\}} archives,
4444
and macOS or Windows binary (\file{.tgz} or \file{.zip},
4545
respectively) packages are supported. Defaults to
4646
\code{"win.binary"} on Windows and to \code{"source"} otherwise.

src/library/utils/R/packages2.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ install.packages <-
194194
get_package_name <- function(pkg) {
195195
## Since the pkg argument can be the name of a file rather than
196196
## a regular package name, we have to clean that up.
197-
gsub("_[.](zip|tar[.]gz|tar[.]bzip2|tar[.]xz)", "",
197+
gsub("_[.](zip|tar[.](gz|bzip2|bz2|xz|zstd|xst))", "",
198198
gsub(.standard_regexps()$valid_package_version, "",
199199
basename(pkg)))
200200
}
@@ -399,7 +399,7 @@ install.packages <-
399399
df <- function(p, destfile, method, ...)
400400
download.file(p, destfile, method, mode = "wb", ...)
401401
urls <- unique(pkgs[web])
402-
402+
403403
if (missing(method) || method == "auto" || method == "libcurl") {
404404
# bulk download using libcurl
405405
destfiles <- file.path(tmpd, basename(urls))
@@ -417,7 +417,7 @@ install.packages <-
417417
} else
418418
pkgs[web] <- destfiles
419419
} else
420-
pkgs[web] <- NA
420+
pkgs[web] <- NA
421421
} else {
422422
# serial download
423423
for (p in urls) {

0 commit comments

Comments
 (0)