atom / archive-view

Open compressed files in Atom
MIT License
31 stars 32 forks source link

Folder structure is not displayed in .zip archvies #16

Closed tdolsen closed 9 years ago

tdolsen commented 9 years ago

OS: Windows 8.1 Atom: 0.175.0 archive-view: 0.44.0

When opening .tar, .tar.gz (and assuming .tgz and the rest of the bunch) I get a nice folder structure, and can easily follow the contents of the archive. (Notice 2 files and 1 folder.)

tar gz

However, when looking at .zip archives folders are interpreted as files, and there is just a flat structure - i.e. no folders. (Notice 3 files and 0 folders.)

zip

The first time (does not happen subsequent times) opening a zip file the console spits out an error message too:

Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'".

(view error full stack at gist tdolsen/1e7a5dc2bf1fb26026d6)

The two archives are obviously based on the same folder with the same contents.

This isn't a big issue with small files like this, but looking through larger archives (which often are shipped as .zip) it becomes impossible to figure out which file is which, and where they reside in the directory structure.

:+1:

kevinsawicki commented 9 years ago

Could you share the file that isn't showing the structure correctly?

Here is the sample zip file I use for testing and it appears to show the structure:

screen shot 2015-02-10 at 11 53 06 am

This raw file is here: https://github.com/atom/node-ls-archive/blob/1b9428475138e41e6fbf27e7c48775dff998ba8a/spec/fixtures/nested.zip

tdolsen commented 9 years ago

Can't share the zip, but the same problem occurs with your test zip.

nested-zip

kevinsawicki commented 9 years ago

Can't share the zip, but the same problem occurs with your test zip.

Thanks for checking this, must be a platform specific issue then.

tdolsen commented 9 years ago

I guess so. Any information I can provide to help figure out the issue?

ChiriVulpes commented 9 years ago

It's doing this for me as well. Anything I can do?

At an initial glance, it seems the problem is in ls-archive. It seems that it might be that the paths of the ArchiveEntry object are stored for me with \ as a folder seperator rather than /

ChiriVulpes commented 9 years ago

Yes, that's the problem, I modifed the object in the devtools inspector so that the paths have / rather than \ and it works. You need a function that does that.

Should I open an issue on ls-archive?