-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create files with a literal /
in the name
#130
Comments
|
@dduponchel Take a peek at https://github.com/sheetjs/test_files/blob/master/AutoFilter.xlsx?raw=true (generated by Excel 2011) and note that directory entries do not show up (at least, according to zip.vim). This is true of zip files from 2007, 2010, 2011, and 2013. The quote which led me to conclude that Excel wasn't generating individual folders comes from ECMA376 Part II (Open Packaging Conventions) Section 9 (Package Model) Subsection 9.1.1 (Part Names):
|
Indeed, Excel doesn't generate sub folders. The change itself is small : we just need a condition on this folderAdd call (and maybe one on |
@dduponchel alternatively you could disable the magic folder-creation behavior entirely (and require people to explicitly create the folder first). |
We could. I tested with some programs (unzip, 7z, the default zip program in windows XP and windows 7) with a zip file with "missing" folders and they all create sub folders when necessary. |
Numbers for iOS is showing some strange behavior. Writing the paths in a different order seems to confuse the parser only if the directory entries show up after the Food for thought: other JS zip implementations (for example, https://www.npmjs.org/package/archiver) and implementations in other languages (https://rubygems.org/gems/rubyzip) don't create those directory entries. |
Wait, what does “don't create those directory entries” mean exactly? “Don't create directory entries that are files with |
@Mithgol consider this script:
All it does is parse Now run this and take a peek at what zip.vim reports:
I'm not sure why, but those extra directory entries are confusing some readers. |
I've tested some archive managers (windows 7 "compressed folders", winzip, winrar, 7zip, izarc) on this :
I've also checked the java API, which doesn't create sub folders. It seems that changing the default behavior shouldn't break anything. |
(this was broken due to Stuk/jszip#130)
OPC requires file names like "foo/bar", but jszip seems to interpret those as folder names:
All of the checks seem to directly look for a slash character. Ideally something like "foo//bar" or "foo/bar" or some other expression would allow for a literal slash in the name
The text was updated successfully, but these errors were encountered: