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

[STABLE 3.7.3] Wiki - Examples - A Complete Extractor, cannot extract .7z.001 files #2134

Open
LukeSkyD opened this issue Apr 19, 2024 · 0 comments

Comments

@LukeSkyD
Copy link

LukeSkyD commented Apr 19, 2024

Hello!
I'm writing a qt cpp project which build with cmake.

I can extract thanks to that code .zip and .7z files no problem.

There is no way to extract .7z.001 files
I've downloaded all the .002 and .003 files, they work great with 7zip and other archive managers.

I tried calling the extract function with the full absolute path, removing .001, removing .7z.001, making some cpp code
`// Check if the file is multi-volume (ends with .001)
if (strstr(filename, ".001") != NULL) {
char multi_volume_pattern[1024];
strncpy(multi_volume_pattern, filename, strlen(filename) - 3); // Remove .001 from the end
multi_volume_pattern[strlen(filename) - 4] = '\0'; // Null-terminate the string

    archive_read_support_format_raw(a);
    r = archive_read_support_filter_none(a);
    if (r != ARCHIVE_OK)
        exit(1);
    r = archive_read_open_filename(a, multi_volume_pattern, 10240);
    if (r != ARCHIVE_OK)
        exit(1);
} else {
    r = archive_read_open_filename(a, filename, 10240);
    if (r != ARCHIVE_OK)
        exit(1);
}`

But the r variable here
r = archive_read_open_filename(a, multi_volume_pattern, 10240); if (r != ARCHIVE_OK) exit(1);
Is always -30 with .7z.001 files.

Help?

EDIT: Also running with the stock example at line

if (r < ARCHIVE_OK) fprintf(stderr, "%s\n", archive_error_string(a));
a red (null) is printed to the console.

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

1 participant