This repository was archived by the owner on Apr 9, 2024. It is now read-only.
forked from tomap/SevenZipSharp
-
Notifications
You must be signed in to change notification settings - Fork 105
How to append files to a splitted archive? #205
Copy link
Copy link
Open
Description
When I use this code it works fine:
string ArchiveFile = Path.Combine(Environment.CurrentDirectory, "Archive.7z");
SevenZipCompressor.SetLibraryPath(Path.Combine(Environment.CurrentDirectory, "7z.dll"));
var compressor = new SevenZipCompressor
{
ArchiveFormat = OutArchiveFormat.SevenZip,
DirectoryStructure = true,
PreserveDirectoryRoot = true
// , VolumeSize = 1000 * 1024 * 10 // 10MB segments
};
// Compress the Files directory
compressor.CompressDirectory(Path.Combine(Environment.CurrentDirectory, "Files"), ArchiveFile);
// Append two files
var modificationList = new List<string>
{
Path.Combine(Environment.CurrentDirectory, "EventLog.txt"),
Path.Combine(Environment.CurrentDirectory, "FileVersions.txt")
};
compressor.CompressionMode = CompressionMode.Append;
compressor.DirectoryStructure = false;
compressor.PreserveDirectoryRoot = false;
compressor.CompressFiles(ArchiveFile, modificationList.ToArray());
but when I want to get a splitted archive (uncomment the line with VolumeSize) I got a Exception:
Could not pack files! Message: file "...\Archive.7z" does not exist.
What do I have to do to make it work?
Metadata
Metadata
Assignees
Labels
No labels