Skip to content

MZ_STREAM_ERROR when trying to write to split archive with >50GB split size #961

@oijroiwjer2134313

Description

@oijroiwjer2134313

Hi,
I am currently working with 55db144 and am having troubles when trying to write to archives with very large split sizes.

const LONGLONG zipSize = 50LL * 1024 * 1024 * 1024; 
zipStream = mz_stream_os_create();
zipWriter = mz_zip_writer_create();
val = mz_zip_writer_open_file(zipWriter, szZIPPath, zipSize,0);
if (val != MZ_OK) {
 //log error
}

mz_zip_file fileInfo = { 0 };
fileInfo.filename = newPath.c_str();
fileInfo.modified_date = FileTimeToUnixTime(modification);
fileInfo.creation_date = FileTimeToUnixTime(creation);
fileInfo.accessed_date = FileTimeToUnixTime(access);
fileInfo.compression_method = MZ_COMPRESS_METHOD_DEFLATE;
fileInfo.zip64 = MZ_ZIP64_AUTO;
fileInfo.uncompressed_size = nFileSize;
fileInfo.version_madeby = MZ_VERSION_MADEBY;
fileInfo.flag |= MZ_ZIP_FLAG_UTF8;

// Open the ZIP entry
err = mz_zip_writer_entry_open(zipWriter, &fileInfo);  
// code to write the entry
mz_zip_writer_entry_close(zipWriter);

//code to eventually close the zipwriter

This all works fine as long as my zipSize stays at 50GB or lower. Once I set it to more than 50GB I get an MZ_STEAM_ERROR when calling
mz_zip_writer_entry_open(zipWriter, &fileInfo);

Am I missing something here / doing something fundamentally wrong?

Thank you for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions