|
-
Aug 19th, 2012, 04:44 AM
#1
Thread Starter
Frenzied Member
Zip archive delete question
I have had a look at the MSDN site for the ZipArchive with no luck.
This is my question: Is it possible to delete a file from a ZipArchive singly rather than have to extract the whole archive, and then create a new archive without the file that I do not want in there?
Basically, what is the easiest way to remove a file from a ZipArchive?
-
Aug 19th, 2012, 05:05 AM
#2
Re: Zip archive delete question
I've never used that functionality myself but, from what I can see, I'd say that the answer is no. My immediate thought was that you would Remove an entry from the Entries collection but it is read-only. I'd say that you'll have to create a new ZipArchive, copy all the entries across and then replace the original file with the new one. That's presumably what would have to be done behind the scenes anyway.
-
Aug 19th, 2012, 05:13 AM
#3
Re: Zip archive delete question
Actually, I tell a lie. You get a ZipArchiveEntry from the ZipArchive and then call its Delete method. I appreciate that you had a go at MSDN for yourself but that took me just a few minutes to find when I've never used these types before simply by reading all the relevant documentation. Don't just stick to one type. Follow the links. I went to ZipArchive, then ZipArchive.GetEntry, then ZipArchiveEntry just by clicking the links and reading, and there was the answer.
-
Aug 19th, 2012, 05:55 AM
#4
Thread Starter
Frenzied Member
Re: Zip archive delete question
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|