Zip File Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Ruro
Experienced Solver
Experienced Solver
Posts: 83
Joined: Wed May 23, 2007 2:20 pm
Location: Verona, Italy

Zip File

Post by Ruro »

Hi,

I wonder if there is a easy way to create a zip file from a poll of files, and then add daily some other file to the zip file.

I saw the documentation of wxZip file, but I don't know if it is the best way to achieve the goal.

Creating the first zip file is not the problem, but the update seems a bit tricky, should I make a new file every time i need to update it with new content?

Thanks for the support,

Nicola.
User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: Zip File

Post by eranon »

Hello,

According to http://docs.wxwidgets.org/3.1.0/overview_archive.html,
To modify an existing archive, write a new copy of the archive to a new file, making any necessary changes along the way and transferring any unchanged entries using wxArchiveOutputStream::CopyEntry().
and
In general modifications are not possible without rewriting the archive, though it may be possible in some limited cases. Even then, rewriting the archive is usually a better choice since a failure can be handled without losing the whole archive. wxTempFileOutputStream can be helpful to do this.
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
Post Reply