SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

How to Insert or append a file to an existing zip-archive?

Last post 06-12-2008 10:18 PM by JohnReilly. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 05-08-2008 2:48 PM

    How to Insert or append a file to an existing zip-archive?

    Hallo, i would like to insert/append a file to an archive, for example

    Insert(string fileName, string archiveName);

    it should insert the file with fileName to archive of archiveName 

    some modification would be: 

    Insert(ZipEntry entry,  string fileName, string archiveName);

    where file should be under the entry placed

    how should i open such a ZipOutputStream? 

    Any idea?

    Thanks

    Pawel 

  • 06-11-2008 9:05 PM In reply to

    Re: How to Insert or append a file to an existing zip-archive?

     Hi,

    ZipOutputStream doesnt support that kind of operation directly.  ZipFile is more amenable to your task I think.  Have a look at the zf c# sample whic exercises this class.

    hth, -jr-

  • 06-12-2008 7:37 AM In reply to

    Re: How to Insert or append a file to an existing zip-archive?

    afaik ZipFile gives you no information about compression-progress. there are no events supported, no observers can be injected.


    I consider, maybe I could use an descendant of FileStream as parameter in his constructor, which has hooks in their Read/Write methods, and gives back the bytecount which was readed. I see no other possibilities of observing the progress. Any other idea?

    Pawel 

    Filed under: ,
  • 06-12-2008 10:18 PM In reply to

    Re: How to Insert or append a file to an existing zip-archive?

    Hi,

    Yes a code tweak is required.  A parameter in the constructor seems less flexible than being able to set it via a property or perhaps when you commit an update.

    Cheers, -jr-

Page 1 of 1 (4 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.