I am using SharpZipLib to zip up a folder with subdirectories and this is working fine. What I would like to do is strip off the parents directories of the first child file so the whole structure that is irrelevant isn't carried forth...
Example:
c:\a\b\c\d\e\f\g\h\file1.txt
c:\a\b\c\d\e\f\g\h\file2.txt
c:\a\b\c\d\e\f\g\h\i\file1.txt
c:\a\b\c\d\e\f\g\h\i\file2.txt
It should end up like this:
file1.txt
file2.txt
i\file1.txt
i\file2.txt
How can I do this?
Here is the code I have so far:
ZipFile zipFile = new ZipFile(destinationArchive);
zipFile.BeginUpdate();
foreach (FileInfo file in sourceFiles)
{
zipFile.Add(file.FullName);
}
zipFile.CommitUpdate();
zipFile.Close();