Unzip - warning and card name

I have a folder that I download from Dropbox using a shared link (not a public link) and curl. It loads as a ZIP folder. I need to unzip this folder using unpacking in a bash shell script. Whenever the folder is unpacked, I get the following errors:

warning: stripped absolute path spec from / mapname: conversion of failed 

Just to make sure it wasn't a strange waving problem, I downloaded the folder directly from Dropbox and tried it again. I have the same error. All files and subdirectories appear, and there seems to be no problem with their integrity. Unpacking any folder with a graphical interface does not result in error messages.

I ran unzip -l and noticed an odd first entry:

  Length Method Size Ratio Date Time CRC-32 Name -------- ------ ------- ----- ---- ---- ------ ---- 0 Defl:N 2 0% 01-23-14 19:38 00000000 / 

I believe that this particular empty directory causes problems. My question is, is there a way to ignore this empty directory or suppress error messages (I tried -qq with no luck)? Or is there something I'm doing wrong / missing?

I tested this on Mac OSX 10.9.1 and Ubuntu Linux (Version Unknown) with the same results.

EDIT: I also tested it with jar xf and it works fine without any errors. Running jar xvf shows that it is created: / . I still think this is an empty, unnamed directory causing the problem, but I cannot force my syntax correctly so that unzip ignores it. I would just use jar, but I need to specify the output directory.

+7
bash curl warnings unzip directory-structure
source share
2 answers

In my opinion, the main problem is the archive, not your team.

By default, we save relative paths in a ZIP file. Example:

 $ zip tmp.zip /home/mcoolive/*txt adding: home/mcoolive/file1.txt (deflated 73%) adding: home/mcoolive/file2.txt (deflated 76%) 

By default, unzip recreates all files, and subdirectories are recreated in the current directory.

In your case, the archive contains absolute paths. This evil. Thus, your client converts absolute paths to relative paths with a warning.

+1
source share

Trying to unzip Dropbox's automatic mailbox from the command line, I also found this message:

 warning: stripped absolute path spec from / mapname: conversion of failed 

I compared the ZIP version of Dropbox with regular mail.

The difference was that during unpacking in Dropbox, a file like / appears in the first position.

I just add the -x / option to the unzip command, trying to exclude it, and it works for me.

+1
source share

All Articles