I want to support split zip files in my project, and to have different implementations case the zip file is split or not. How do I check if the zip file is split?
using Ionic.Zip;
protected static bool IsZipFileSplit(string filePath)
{
try
{
ZipFile zipFile = new ZipFile(filePath);
bool isSplit = ?????
return isSplit;
}
catch (ZipException) { }
catch (IOException) { }
}
At the moment i'm using Ionic.Zip (DotNetZip Library). As I understand, it does not export any public data regarding if a zip file is split or not. It does have the public property NumberOfSegmentsForMostRecentSave, but the value refers only to the last save of the current zip file and not for new zip files opened with existing split zip file path.
Ionic.Zip library did not support at that time working with split zip files. After our research we chose to work with DotNetZip library which supports working with split zip files.
Taken from the DotNetZip.ZipFile.Info property:
public string Info
{
get
{
StringBuilder stringBuilder = new StringBuilder();
...
stringBuilder.Append(string.Format(" disk with CD: {0}\n", (object)this._diskNumberWithCd));
return stringBuilder;
}
}