This project is read-only.

Adding attributes to stream-compressed files

Apr 17, 2010 at 10:20 PM

Having to rely on streams for file compression, I've run into a few limitations using this library. When compressing files by specifying their path, the library automatically stores any relevant attributes in the archive. When using streams, this is obviously not the case, because streams don't necessarily represent a file.

However, I would like to add some properties (such as creation, modification and last access timestamps, or more if possible) to the resulting file inside the archive. I assume this is possible, since the 7z format obviously supports such attributes, but SevenZipSharp doesn't seem to support it.

I can think of three ways to expose such a feature: Provide a method that can modify the attributes of a file that is already in an archive; Provide a compress method with more parameters to support all the relevant attributes; Wrap all data relevant to a file (source stream or path, target path inside archive, attributes/timestamps) in a class and provide a method that compresses an array of such objects.

If I had enough time to comprehend SevenZipSharp's source code, I could (maybe) implement this myself. Unfortunately, the concepts of invoking DLL functions and the C# language in itself are both fairly new to me. :)

Apr 23, 2010 at 8:17 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.