James Hogle
James Hogle

Reputation: 3040

Using TZipFile to create a new zip file

I am attempting to use the TZipFile class to create a new zip file and add some files to it. I am able to add files to an existing zip file using this code:

TZipFile *  zip = new TZipFile();
zip->Open(fileName, zmReadWrite);
zip->Add("C:\\0\\t.txt");
zip->Close();

However, I am not sure how I can create a new zip file in code, and then add files to it. I tried calling zip->Open on a non-existent file thinking that maybe that would create the archive, however that just caused an access violation.

Upvotes: 1

Views: 1143

Answers (1)

vlad
vlad

Reputation: 1

For creating a new zip-file you must choose zmWrite.

Upvotes: 0

Related Questions