Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • -unzipfile- unzipping zipx files: could not perform unzip r(601)

    I am trying to unzip a set of zip files using -unzipfile- in a loop and all files unzip successfully except one. I found out that one file is actually a zipx file. Why I try to unzip this problematic file with the trace on, I get the output below. 7-Zip or Windows can open the file. I am wondering if this is a compatibility issue that is specific to the program that Stata uses for unzipping, and if I should report it somehow.

    Code:
    . unzipfile 199703.zip, replace
    -------------------------------------------------------------------- begin unzipfile ---
    - version 11.0
    - syntax anything[, replace]
    - gettoken ZipFileName rest : anything
    - if (`"`rest'"' != "") {
    = if (`""' != "") {
      di as error "invalid syntax"
      exit 198
      }
    - if (`"`replace'"' != "") {
    = if (`"replace"' != "") {
    - local overwrite "overwrite"
    - }
    - mata : zipfile_cmd()
        error unzipping file: 9703.dat
    could not perform unzip
    ---------------------------------------------------------------------- end unzipfile ---
    r(601);

  • #2
    I believe unzipfile only works with .zip files. I use 7-zip's command line program to do all of my compressed archive work. See my post here for some examples.

    Comment


    • #3
      Thank you, Chris, for the suggestion. I actually tried using 7-Zip's command in Stata with -shell- but things get really messy when cmd windows keep popping. I don't prefer using ! if there isn't an absolute need. In this case, I think the package Stata uses for -unzipfile- (I think pkzip) needs an update.

      Comment


      • #4
        Stata documentation (see help unzipfile) is clear about what it supports.

        unzipfile extracts files and directories from a file in zip archive format into the current directory. unzipfile can open zip files created by WinZip, PKZIP 2.04g, and other applications that use the zip archive format.
        And winzip.com makes it clear that a zipx archive implements other file compression methods in addition to those included in the zip file format specification:

        A Zipx file (.zipx) is a Zip file in which WinZip has used one or more of its available advanced compression methods. The .zipx extension makes it clear that the file was created using an advanced compression method. This helps if you plan to share highly compressed files with others.... The .zipx extension quickly and easily conveys that WinZip, or another compatible compression utility, will be required to open the file.

        ​I can agree that it would be helpful if unzipfile supported the zipx file format in addition to the zip file format, but along with zipx there are a number of other file formats that others would argue as helpful for Stata to also support.

        Comment

        Working...
        X