Announcement

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

  • Stata unzipfile fails

    I have encountered a zip archive, which Stata fails to unpack.
    The specific message is "I/O error on read, error may be caused by incorrect password" r(601)

    Click image for larger version

Name:	Stata_unzipfile_error.png
Views:	1
Size:	2.9 KB
ID:	1470408


    A bunch of other files from the same archive are unzipped correctly.
    I have checked for the archive integrity using a bunch of alternative tools, (winrar and other) and none of them have reported any problem.
    I have checked for problems with data transfer, no problem.
    I have checked and confirmed that password protection was not engaged anywhere during the production of this file.

    On failure the file is created with the zero length and remains open (locked) until the whole Stata session is closed. I have found no way to close the file and delete the zero-length file.
    The offending file is characterized as "deflated, 84%" and the original size is 22,790 while compressed size is 3,606 bytes. All of the files I've checked from this archive use the same "deflated" compression.

    I believe this is a Stata problem, rather than the zip-file problem.

    Observed in Stata 15.0 for Windows and a bunch of earlier versions.

    If the problem is confirmed, perhaps Stata could
    A) skip the files it can't unpack and continue, reporting the number of files skipped.
    B) provide a way to acquire the list of files in the archive and unpack selectively.
    C) properly close the file when any error is encountered.

    Thank you, Sergiy Radyakin

  • #2
    I see that in "help whatsnew", part of version 15.1 says,
    zipfile and unzipfile now produce and extract compressed files
    larger than 2 GBs.
    if your file is larger than 2 GB, you might want to update

    added: just noticed that your file is much smaller so above not relevant (but you should still update)

    Comment


    • #3
      Dear Rich,

      thank you very much for the pointer. Updating to current version 15.1 made all the difference. (product version 521.15.1.632).
      While the files I have are all under 2GB the updated version of Stata could process them correctly. Perhaps this is the result of some fixing, which left unannounced.

      My issue is resolved now.

      Thank you, Sergiy

      Comment


      • #4

        strangely enough, under version control the older behavior is restored and Stata again fails to unpack the file (different file this time). The same code executed in most recent Stata 15.1 with version 14.0 statement fails, while succeeds with version 15.1 statement. I don't think this may be desirable, and goes against #3 here.

        Demo code:
        Code:
        clear all
        
        version 15.1
        mkdir 15
        cd 15
        unzipfile ../testfile.zip
        cd ..
        
        version 14
        mkdir 14
        cd 14
        unzipfile ../testfile.zip
        cd ..
        
        // end of file
        Below is the info about the archive. I can't share the original file.
        Click image for larger version

Name:	archive.png
Views:	1
Size:	9.6 KB
ID:	1487759



        Executable info:
        Stata/MP 15.1 for Windows (64-bit x86-64), Revision 20 Feb 2019, compile number 635.


        The same behavior was observed with the 15th October 2018 update.

        Best, Sergiy

        Comment


        • #5
          Sergiy, it appears that your file is > 2 GB (~2.4 GB). Perhaps this contributed to the issue.

          Comment


          • #6
            No, the archive size is 2.4MB (2.5 million bytes or precisely 2,518,535 bytes) in size.
            Well under the critical value.
            The size on the screenshot is the total size of the unpacked files in bytes.
            The size of the archive is 531,010 bytes and the size of the file on which it stumbles is 1,474 bytes.

            Comment


            • #7
              Oh, my mistake. Thank you for clarifying.

              Comment

              Working...
              X