Hi,
I am working with some log files I generate with another application. My intention is to archive them and then delete the large log file and have it stored in a compressed format for later access. This works when I use ZipArchiveMode.Create. Where this falls apart is that if I delete the file after I have added it to the archive, and then run the program again, it is not keeping the old entries in the archive - since I am using "Create". I also wanted to save time that if the file I wanted to add was already in the archive, it would skip adding it. A query against the Entries property of the ZipArchive does not seem to work when the mode is set to Create - it might work for the first time I ask, but once I add a file I get an error. I then attempted to use ZipArchiveMode.Update, but then I received and ObjectDisposedException {"Cannot access a closed Stream."}.
I am using the code found in this post
http://www.telerik.com/forums/zip-content-of-a-folder-into-an-encrypted-zip-file
to add the existing files to the archive.
So I'm not sure if I am using the ZipArchive incorrectly, or I need to do it a different way, but help and guidance would be appreciated. I can create a demo app if needed.
Thanks,
Chris
I am working with some log files I generate with another application. My intention is to archive them and then delete the large log file and have it stored in a compressed format for later access. This works when I use ZipArchiveMode.Create. Where this falls apart is that if I delete the file after I have added it to the archive, and then run the program again, it is not keeping the old entries in the archive - since I am using "Create". I also wanted to save time that if the file I wanted to add was already in the archive, it would skip adding it. A query against the Entries property of the ZipArchive does not seem to work when the mode is set to Create - it might work for the first time I ask, but once I add a file I get an error. I then attempted to use ZipArchiveMode.Update, but then I received and ObjectDisposedException {"Cannot access a closed Stream."}.
I am using the code found in this post
http://www.telerik.com/forums/zip-content-of-a-folder-into-an-encrypted-zip-file
to add the existing files to the archive.
So I'm not sure if I am using the ZipArchive incorrectly, or I need to do it a different way, but help and guidance would be appreciated. I can create a demo app if needed.
Thanks,
Chris