MacOS – Error opening a zip file: No such file or directory

macoszip

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?

Best Answer

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.