Skip to content
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

Error when trying to unrar archive with subfolders #5

Closed
ThomasDotCodes opened this issue Jul 6, 2016 · 8 comments
Closed

Error when trying to unrar archive with subfolders #5

ThomasDotCodes opened this issue Jul 6, 2016 · 8 comments

Comments

@ThomasDotCodes
Copy link
Contributor

ThomasDotCodes commented Jul 6, 2016

Here is an example of the file:

test.zip (and test.rar)
_______/testfolder/
________________file1.jpg
________________file2.jpg

When using archive.Unzip, it behaves as expected -- creates the subfolders as they are in the zip archive:
err := archiver.Unzip("c:\\tmp\\test.zip", "c:\\tmp\\test\\")

However when running the same command to unrar, it appears as though it's not able to Mkdir the subfolders.
err := archiver.Unrar("c:\\tmp\\test.rar", "c:\\tmp\\test\\")

Error:

c:\tmp\test\testfolder\file1.jpg: creating new file: open c:\tmp\test\testfolder\file1.jpg: The system cannot find the path specified.

If it helps, line 41 of rar.go is checking
if header.IsDir but it seems to evaluate as false, since technically the path includes both the folder and the filename (I'm assuming).

@mholt
Copy link
Owner

mholt commented Jul 6, 2016

Thanks for the report! So are file1.jpg and file2.jpg inside testfolder?

@ThomasDotCodes
Copy link
Contributor Author

correct, those files are within the subfolder (inside the archive).

@mholt
Copy link
Owner

mholt commented Jul 6, 2016

Thanks. Can you send me the .rar file? I don't have a way to make them (and I'd rather not install one on my Mac... heh) 😄 My email address is at https://matt.chat.

@ThomasDotCodes
Copy link
Contributor Author

No problem, sent you the file I've been testing against.

@mholt
Copy link
Owner

mholt commented Jul 7, 2016

Got it, thanks. Will check it out soon!

@ThomasDotCodes
Copy link
Contributor Author

ThomasDotCodes commented Jul 8, 2016

Quick and dirty string comparison workaround here:
#7

@mholt
Copy link
Owner

mholt commented Jul 11, 2016

Fixed in #7. Thank you!

@mholt mholt closed this as completed Jul 11, 2016
@mholt
Copy link
Owner

mholt commented Jul 11, 2016

I've published a new release with this and another fix: https://github.com/mholt/archiver/releases/tag/v1.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants