Closed chainsawriot closed 3 months ago
This works with the current CRAN version 1.1.1
withr::with_tempdir({
mylist <- list(
mtcars3 = mtcars[1:10, ],
mtcars2 = mtcars[11:20, ],
mtcars1 = mtcars[21:32, ]
)
rio::export_list(mylist, file = paste0("file_", 1:3, ".csv"), archive = "arch/archive.zip")
file.exists("arch/archive.zip")
})
But not with HEAD
By adding back these two lines to HEAD
, this test works.
1f2cfe8c4d7e92cb3432904d3b7bb2ee10b20138
https://github.com/gesistsa/rio/pull/434#issuecomment-2220474755
As it turns out, that setwd()
call is important for exporting compressed file to a relative path, e.g. arch/archive.zip
and we can't do that on.exit
. b/c that copy operation depends on where the current working directory is.
Is there a better way to handle this? And #319 is still a hanging problem.
Until a better solution is derived for #319 , I will add back that setwd()
. Please continue the discussion about possible solution in #319.
Which also got emitted on CI. And actually, the expected file is not created.