59

After 25 years on PCs I am delighting in learning all I can about working with my new Mac and OS X Mavericks.

I tried just now to open a zip file but was interrupted with an Archive Utility dialog:

Unable to expand "filename.zip" into "Downloads".
(Error 2 - No such file or directory.)

Error 2 - No such file or directory.

What to do? How can I access the contents of the zip file?

3 Answers 3

74

It's likely that filename.zip is either not actually a .zip file, or is corrupted.

Open up Terminal. You can access it by typing "Terminal" into Spotlight.

Enter the command(s) in the steps below into your command line prompt (triple click the line, copy it, and paste it into your prompt). Replace filename.zip with the actual name of the zip file.

If the name of the file contains spaces, you need to enter it differently using the escape \ character. For example, if the file is named compressed crap.zip, you'd type compressed\ crap.zip in the command line.

Step 1:

Repair disk permissions. Once done, attempt to open the .zip file again. If you wish, you can do this from the command line.

diskutil repairPermissions /

Step 2:

Use file to confirm it's actually a zip file:

file ~/Downloads/filename.zip

The output should be: Zip archive data, at least v2.0 to extract

If you don't receive this output, post the output as a comment before proceeding.

Step 3:

After confirming it's actually a zip file, attempt to unzip it directly from the command line:

unzip ~/Downloads/filename.zip -d ~/Downloads

Step 4:

Step 3 will likely fail. Run the zip command to attempt to repair any corruption and salvage the contents of the archive (again, replace filename.zip with actualname.zip):

zip -FF ~/Downloads/filename.zip --out ~/Downloads/Repairedversion.zip

If it executes cleanly, you'll be directly returned to your prompt. Quit Terminal. Navigate to your Downloads folder and double click Repairedversion.zip- it should unzip without issue.

Alternatively, it may not exit cleanly. If you're presented with

Is this a single-disk archive? (y/n):

Hit the y key. After you're returned to the prompt, again attempt to open Repairedversion.zip from your Downloads folder. If you're still unable to open it, comment below with the warning(s) received from the command. If you've reached this point though, it's likely that the file is irreparably damaged.

8
  • 3
    You can also drag-n-drop the file into the terminal window, instead of typing the directory/filename. This also corrects automatically the optional spaces in the filename
    – Mathias711
    Jun 23, 2014 at 8:23
  • Thanks for theses great instructions! I just tried steps 1-4. This is what I got when terminal finally choked on it. It was going along so well.. any help is greatly appreciated. Central Directory found... zip warning: Entry too big:Transmission/Zero.Dark.Thirty.2012.720p.BluRay.x264-Felony/f-zerodarkthirty.720p.mkv zip error: Entry too big to split, read, or write (Poor compression resulted in unexpectedly large entry - try -fz)
    – user88782
    Aug 26, 2014 at 2:55
  • I'm receiving these errors: zip warning: no end of stream entry found: _file_inside_archive_ zip warning: rewinding and scanning for later entries Is there anything else that can be done to recover the archive's contents?
    – HGDev
    Jun 17, 2015 at 0:59
  • When trying the unzip step I got many unexpected replace <some path>? messages. Replacing them solved the problem. Something was rather wrong with the zip file.
    – Federico
    Dec 14, 2015 at 0:57
  • 1
    This no longer works on OS 10.13. diskutil no longer allows you to repair permissions
    – Adam_G
    Aug 2, 2018 at 16:23
1

There are a number of things that could have happened here. The easiest way of resolving this is to re-download (or re-copy) the zip file from it's original source and re-try opening it up again. Without having more information, here's a list of possible things that could be happening:

  • The zip "folder" doesn't exist. You wrote folder, but I'm assuming you meant file. What could happen is that you marked a normal, non-zip, file as a zip file by accidentally adding .zip to the end of the file name. So your computer thinks it is a zip file but it's not actually a zip file.
  • The destination doesn't exist. From the error message, you might not actually have a Downloads folder.

All of these problems are non-intuitive and the fixes for them are equally non-intuitive and technical. I think your best bet is trying to re-acquire the file again.

0

Try opening the file with an app other than Archive Utility, which is the unarchiver built in to macOS.

I used the app Keka. It too encountered an error:

Extraction of "filename.zip" failed
Error code 2 using "p7zip"
Fatal error

However it also was able to unzip a directory that contained 6 complete image files, along with a 7th failed "Zero bytes" image that failed extraction.

Using this app, or some other 3rd party unzipping app, you may be able to recover at least some of the files from the corrupted archive.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .