Skip to content

Commit f6c59a8

Browse files
committed
don't clean up tempdir
1 parent dc8566f commit f6c59a8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

R/tar-terra-rast.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,10 @@ tar_terra_rast <- function(name,
137137
tar_rast_read <- function(preserve_metadata) {
138138
switch(preserve_metadata,
139139
zip = function(path) {
140-
tmp <- withr::local_tempdir()
140+
tmp <- tempdir()
141+
# NOTE: cannot use withr::local_tempdir() because the unzipped files need
142+
# to persist so that the resulting `SpatRaster` object doesn't have a
143+
# broken file pointer
141144
zip::unzip(zipfile = path, exdir = tmp)
142145
terra::rast(file.path(tmp, basename(path)))
143146
},

0 commit comments

Comments
 (0)