Append to file

Jun 17, 2009 at 6:08 PM

Is there a way to append to a .7z file that already exists?

The process I'm working on requires that every hour a list of files provided are compressed and added to the .7z file supplied.  The relative pathing should be the same.  From what I understand the files are logs from an application that is always running.  Every hour or so the process is to take the logs generated and add them to the .7z file.

I can't seem to figure out how to append though.  I can compress the file list fine, but when I try to append it just overwrites the file.

Any help would be appreciated.

Coordinator
Jun 17, 2009 at 7:12 PM
I have not implemented update capabiliity yet. I had several similar requests. Started to implement it, this feature does not require any hard COM hacks, so i think it will be ready in two or three days.
Sep 24, 2009 at 1:37 PM

Hi,

I still seem to be getting the same/similar issue when I append files to an existing .7z file. 

I satrt with a 248k 7z and when I am finished I have a 1k 7z with 1 file in.  (not the one I was trying to add)

The code I have is loosely based on the example project

Dictionary<String, String> fileDict = new Dictionary<String, String>();

var compressor = new SevenZipCompressor();

compressor.ArchiveFormat = OutArchiveFormat.SevenZip;

compressor.CompressionLevel = CompressionLevel.Normal;

compressor.CustomParameters.Add("s", "off");

compressor.CompressionMethod = CompressionMethod.Lzma;

compressor.CompressionMode = CompressionMode.Append;

fileDict.Add(@"D:\Test\test.ini", "Test.ini");

compressor.CompressFileDictionary(fileDict, @"D:\Test\Test.7z");

 

Is this the best approach or is there another way.

Sep 26, 2009 at 2:06 PM

Was append capability added?  I would like to use it, if possible.

Thanks for writing this library - very helpful.