-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
utils::unzip error "cannot open file" in get_planes() #10
Comments
Hmmm.. really strange. Thanks for the thoroughness! I haven't been able to replicate this in any of the environments I have access to. Will come back to this in a few days and see if anything jumps out at me, but definitely let me know if you have any hunches on where this might be coming from. |
When you say "Master.txt is in that directory", do you mean |
Apologize. I meant |
No worries! Thanks for the clarification. Hmm.. are you on a local setup with administrator permissions? I don't fully understand how |
I'm local. Where are these |
These are the lines that seem to be giving you trouble. After setting the following values, does running that code go smoothly for you?
|
Yep, no problems. |
It's the unzip inside I bolded the line where the traceback highlighted the approximate location, but the indents are screwed up function (zipfile, files = NULL, list = FALSE, overwrite = TRUE,
junkpaths = FALSE, exdir = ".", unzip = "internal", setTimes = FALSE)
{
if (identical(unzip, "internal")) {
if (!list && !missing(exdir))
dir.create(exdir, showWarnings = FALSE, recursive = TRUE)
res <- .External(C_unzip, zipfile, files, exdir, list,
overwrite, junkpaths, setTimes)
if (list) {
dates <- as.POSIXct(res[[3]], "%Y-%m-%d %H:%M",
tz = "UTC")
data.frame(Name = res[[1]], Length = res[[2]], Date = dates,
stringsAsFactors = FALSE)
}
else invisible(attr(res, "extracted"))
}
else {
WINDOWS <- .Platform$OS.type == "windows" if (!is.character(unzip) || length(unzip) != 1L || !nzchar(unzip)) stop("'unzip' must be a single character string")
zipfile <- path.expand(zipfile)
if (list) {
res <- if (WINDOWS)
system2(unzip, c("-ql", shQuote(zipfile)), stdout = TRUE)
else system2(unzip, c("-ql", shQuote(zipfile)),
stdout = TRUE, env = c("TZ=UTC"))
l <- length(res)
res2 <- res[-c(2, l - 1, l)]
res3 <- gsub(" *([^ ]+) +([^ ]+) +([^ ]+) +(.*)",
"\\1 \\2 \\3 \"\\4\"", res2)
con <- textConnection(res3)
on.exit(close(con))
z <- read.table(con, header = TRUE, as.is = TRUE)
dt <- paste(z$Date, z$Time)
formats <- if (max(nchar(z$Date) > 8))
c("%Y-%m-%d", "%d-%m-%Y", "%m-%d-%Y")
else c("%m-%d-%y", "%d-%m-%y", "%y-%m-%d")
slash <- any(grepl("/", z$Date))
if (slash)
formats <- gsub("-", "/", formats)
formats <- paste(formats, "%H:%M")
for (f in formats) {
zz <- as.POSIXct(dt, tz = "UTC", format = f)
if (all(!is.na(zz)))
break
}
z[, "Date"] <- zz
z[c("Name", "Length", "Date")]
}
else {
args <- character()
if (junkpaths)
args <- c(args, "-j")
if (overwrite)
args <- c(args, "-oq", shQuote(zipfile))
else args <- c(args, "-nq", shQuote(zipfile))
if (length(files))
args <- c(args, shQuote(files))
if (exdir != ".")
args <- c(args, "-d", shQuote(exdir))
if (WINDOWS)
system2(unzip, args, stdout = NULL, stderr = NULL,
invisible = TRUE)
else system2(unzip, args, stdout = NULL, stderr = NULL)
invisible(NULL)
}
}
} |
I think I got something. MASTER.txt doesn't get deleted with |
This issue seems to be what I'm dealing with. I have the latest version 1.3.1, so I dunno. |
Oof... I appreciate all of your energy in tracking this down. I'm going to let this issue sit for a bit and see if anyone runs into the same issue. |
Master.txt is in that directory, but I don't know what the problem is.
current session info
The text was updated successfully, but these errors were encountered: