Open chainsawriot opened 1 year ago
The setwd()
in compression.R
is not needed if zip
is done with root
dir.create(tmp <- tempfile())
dir.create(file.path(tmp, "mydir"))
cat("first file", file = file.path(tmp, "mydir", "file1"))
cat("second file", file = file.path(tmp, "mydir", "file2"))
zipfile <- tempfile(fileext = ".zip")
zip::zip(zipfile, files = list.files(file.path(tmp, "mydir")), root = file.path(tmp, "mydir"))
zip::zip_list(zipfile)
#> filename compressed_size uncompressed_size timestamp permissions
#> 1 file1 15 10 2023-09-04 11:41:24 664
#> 2 file2 16 11 2023-09-04 11:41:24 664
#> crc32 offset
#> 1 00effe3a 0
#> 2 735af9a0 66
Created on 2023-09-04 with reprex v2.0.2
zip
is a dependency of openxlsx
anyway; and it also allows Windows support (without RTools).
(We can ignore the long line)