SaveSplit

SevenZipArchive.SaveSplit method

Saves multi-volume archive to destination directory provided.

public void SaveSplit(string destinationDirectory, SplitSevenZipArchiveSaveOptions options)
ParameterTypeDescription
destinationDirectoryStringThe path to the directory where archive segments to be created.
optionsSplitSevenZipArchiveSaveOptionsOptions for archive saving, including file name.

Exceptions

exceptioncondition
InvalidOperationExceptionThis archive was opened from existing source.
ArgumentNullExceptiondestinationDirectory is null.
SecurityExceptionThe caller does not have the required permission to access the directory.
ArgumentExceptiondestinationDirectory contains invalid characters such as “, >, <, or |.
PathTooLongExceptionThe specified path exceeds the system-defined maximum length.

Remarks

This method compose several (n) files filename.7z.001, filename.7z.002, …, filename.7z.(n).

Can not make existing archive multi-volume.

Examples

using (SevenZipArchive archive = new SevenZipArchive())
{
    archive.CreateEntry("entry.bin", "data.bin");
    archive.SaveSplit(@"C:\Folder",  new SplitSevenZipArchiveSaveOptions("volume", 65536));
}

See Also