Skip to content
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

rio::import not working for zip files #425

Closed
alexmunday17 opened this issue May 29, 2024 · 2 comments
Closed

rio::import not working for zip files #425

alexmunday17 opened this issue May 29, 2024 · 2 comments

Comments

@alexmunday17
Copy link

filename <- "tmp.csv"
zip_file <- "test.zip"
write.csv(1, filename)
zip(zip_file, filename)
x <- rio::import(zip_file)
file.remove(filename)
file.remove(zip_file)

This works on rio 1.0.1 but not rio 1.1.0.
It looks to be something to do with this commit

@chainsawriot
Copy link
Collaborator

@alexmunday17 Thanks for the report. I can confirm this.

rio/R/import.R

Lines 138 to 139 in c6c626d

format <- ifelse(isFALSE(missing(format)), tolower(format), get_info(file)$input)
file <- parse_archive(cfile, which = which, file_type = f$compress)

I will explore reversing these two lines.

chainsawriot added a commit that referenced this issue Jun 2, 2024
no tests yet
@chainsawriot
Copy link
Collaborator

chainsawriot commented Jun 2, 2024

@alexmunday17 It is now fixed. Please use the Github version for now. I will upload a version to CRAN soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants