Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why does my Unix UnZip extract flat filenames with backslashes in them instead of a subdirectory tree?

0
Posted

Why does my Unix UnZip extract flat filenames with backslashes in them instead of a subdirectory tree?

0

Short answer: because that’s how they’re stored in the zipfile, and backslashes (‘\’) are regular filename characters, not directory separators. Longer answer: older versions of WinZip (and, no doubt, some other clone zippers) stored filenames using backslashes as directory separators in violation of PKWARE’s appnote, which specifies that forward slashes (‘/’) should be used. Newer versions of WinZip correct that bug, so if you created the archive in question, you should upgrade. If someone else did, you should ask them to upgrade. There is no capability in Unix UnZip to treat backslashes as directory separators (since they’re perfectly acceptable filename characters, just like colons, quotes, and pretty much everything other than forward slashes), so if you want to extract the archive as a subdirectory tree without hacking the source code, you’ll need to rename the archive entries. See the next item for more information about that.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123