Error With Zipfile In Unzgetcurrentfileinfo
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies
C++ Zip File Library
of this site About Us Learn more about Stack Overflow the company c++ create zip file Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges c++ libzip Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute:
Minizip
Sign up R exdir does not exist error up vote 3 down vote favorite I'm trying to download and extract a zip file using R. Whenever I do so I get the error message Error in unzip(temp, list = TRUE) : 'exdir' does not exist I'm using code based on the Stack Overflow question Using R to download zipped data file, extract,
How To Use Minizip
and import data To give a simplified example: # Create a temporary file temp <- tempfile() # Download ZIP archive into temporary file download.file("http://cran.r-project.org/bin/windows/contrib/r-release/ggmap_2.2.zip",temp) # ZIP is downloaded successfully: # trying URL 'http://cran.r-project.org/bin/windows/contrib/r-release/ggmap_2.2.zip' # Content type 'application/zip' length 4533970 bytes (4.3 Mb) # opened URL # downloaded 4.3 Mb # Try to do something with the downloaded file unzip(temp,list=TRUE) # Error in unzip(temp, list = TRUE) : 'exdir' does not exist What I've tried so far: Accessing the temp file manually and unzipping it with 7zip: Can do this no problem, file is there and accessible. Changing the temp directory to c:\temp. Again, the file is downloaded successfully, I can access it and unzip it with 7zip but R throws the exdir error message when it tries to access it. R version 2.15.2 R-Studio version 0.97.306 Edit: The code works if I use unz instead of unzip but I haven't been able to figure out why one works and the other doesn't. From CRAN guidance: unz reads (only) single files within zip files... unzip extracts files from or list a zip archive r unzip rstudio
Sign in Pricing Blog Support Search GitHub This repository Watch 57 Star 304 libzip tutorial Fork 91 hadley/readxl Code Issues 105 Pull requests 17 Projects
Minizip Documentation
0 Pulse Graphs New issue Error: error -103 with zipfile in unzGetCurrentFileInfo when reading an visual c++ unzip file xlsx file, Windows #126 Open Robinlovelace opened this Issue Sep 8, 2015 · 0 comments Projects None yet Labels None yet Milestone http://stackoverflow.com/questions/15226150/r-exdir-does-not-exist-error No milestone Assignees No one assigned 1 participant Robinlovelace commented Sep 8, 2015 Reproducible example on Windows 64 bit: url <- "http://www.ifs.org.uk/bns/bn19figs.xlsx" downloader::download(url, destfile = "bn19figs.xlsx") f <- "bn19figs.xlsx" df <- readxl::read_excel(f, sheet = 15) devtools::session_info() Session info --------------------------------------------------------------------------------------------------------------- setting value version R version 3.2.2 (2015-08-14) system x86_64, mingw32 https://github.com/hadley/readxl/issues/126 ui RStudio (0.99.465) language (EN) collate English_United Kingdom.1252 tz Europe/London Packages ------------------------------------------------------------------------------------------------------------------- package * version date source curl 0.9.3 2015-08-25 CRAN (R 3.2.2) devtools 1.8.0 2015-05-09 CRAN (R 3.2.2) digest 0.6.8 2014-12-31 CRAN (R 3.2.2) downloader 0.4 2015-07-09 CRAN (R 3.2.2) git2r 0.11.0 2015-08-12 CRAN (R 3.2.2) memoise 0.2.1 2014-04-22 CRAN (R 3.2.2) Rcpp 0.12.0 2015-07-25 CRAN (R 3.2.2) readxl 0.1.0 2015-04-14 CRAN (R 3.2.2) rversions 1.0.2 2015-07-13 CRAN (R 3.2.2) xml2 0.1.2 2015-09-01 CRAN (R 3.2.2) Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment Contact GitHub API Training Shop Blog About © 2016 GitHub, Inc. Terms Privacy Security Status Help You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
and get tips & solutions from a community of 418,547 IT Pros & Developers. It's quick & easy. Reading the contents of zip files 100+ P: 424 arnaudk I have a large number of sequentially-named zip files, each containing a single csv data file which https://bytes.com/topic/c/answers/764381-reading-contents-zip-files I need to read into my C++ program. 1) Does anybody know of any open source libraries to handle zip files? (I've seen some unportable, expensive commercial ones only). 2) I could use a free program like gzip which can decompress zip files. I don't want to decompress each archive to disk and read in the resultant csv file as this would be excruciatingly slow. Instead, I've seen you can pipe the output of gzip to another program. Is it possible, using system() calls to gzip, to capture this zip file piped output as an fstream or some other stream which I can then getline() to read the csv data rows? Jan 28 '08 #1 Post Reply Share this Question 11 Replies Expert 100+ P: 463 RRick On linux, gzip wants to create a single compressed file for each file passed. This doesn't sound like what you want If you want to combine multiple files into a single compressed file, the tar command is the way to go. For linux, it is the archive workhorse. It will store and extract error with zipfile single or multiple files; supports directories; puts them in their own directories; or sends them to stdout. What more could you ask for? :-) Jan 29 '08 #2 reply Expert 100+ P: 1,275 gpraghuram I have a large number of sequentially-named zip files, each containing a single csv data file which I need to read into my C++ program. 1) Does anybody know of any open source libraries to handle zip files? (I've seen some unportable, expensive commercial ones only). 2) I could use a free program like gzip which can decompress zip files. I don't want to decompress each archive to disk and read in the resultant csv file as this would be excruciatingly slow. Instead, I've seen you can pipe the output of gzip to another program. Is it possible, using system() calls to gzip, to capture this piped output as an fstream or some other stream which I can then getline() to read the csv data rows? You idea 2 is good. I remeber that there is a command whicn say what are all the files available inside the zipped file without opening it.(I dont remember the exact name). With ur second idea even if you tryto unzip with pipe command then also the files will be unzipped. I dont think that can boost the speed Raghuram Jan 29 '08 #3 reply 100+ P: 424 arnaudk Thanks for your replies, RRick: I don't need to create any archives. I just have a collection of zip files, each containing one single file which I need to read into objects in my program, so