Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET Question regarding API, Performance and Mono support

3 sujets de 1 à 3 (sur un total de 3)
  • Auteur
  • wqh
    Post count: 2
    #44132 |

    I’m testing different Zip libraries to see which on fix our product well. Now I have below questions.
    1. I have a list to store the path of files or even empty directories to zip. I found QuickZip.Zip might work for me. The list may contains the path as follows.


    I want the paths in the zip file are


    However, QickZip’s all overloaded Zip methods don’t provide a parameter to specify the relative path in the final zip file. In stead, the AddEntry or AddFile in SharpZipLib and DotNetZipLib provide that kind of parameter. I’m wondering how to put all the files into a zip file without the root dir1?

    2. « Deflate compression method can now use multiple threads for increased compression speed. » I assume this means users don’t bother to write their own multi-threaded code. The Zip library works in a multi-threaded way. DotNetZipLib is working in this way. But after performance testing on Windows, I found Xceed Zip is far behind DotNetZipLib and is also a little behind SharpZipLib. Is this caused by lacking of a official license or actually I should write my own multi-threaded code to improve performance?

    3. I need the library working properly on both Windows and Linux. But I found an old post saying the Mono is not officially supported. http://forums.xceed.com/forums/topic/Mono-support/ When I started my application on a Redhat Linux 6.5 machine, I found the assembly of Xceed could not be loaded.

    Looking forward to the answers and many thanks in advance.

    Fawzi [Xceed]
    Post count: 722


    #1 You are correct, QuickZip doesn’t handle that scenario. Here’s how you could do it:

    static void Case166656()
    // Select a zip file
    AbstractFile zipFile = new DiskFile( « Case166656.zip » );

    // If the zip file already exists
    if( zipFile.Exists )
    // Delete it as we want to create a new zip file

    // Wrap the zip file with a logical zip archive
    ZipArchive zip = new ZipArchive( zipFile );

    AbstractFile source;
    AbstractFile destination;
    string destinationPath;

    // This is the base directory we will strip from all destinations
    string baseDir = @ »C:\dir1\ »;

    // Batch modifications to the zip archive to improve performance
    using( AutoBatchUpdate batch = new AutoBatchUpdate( zip ) )
    // Select a source file
    source = new DiskFile( @ »C:\dir1\dir2\dir3\file1″ );

    // Remove the base directory path from the source path
    destinationPath = source.FullName.Substring( baseDir.Length );

    // Get a destination file from the zip archive using the relative path we want
    destination = zip.GetFile( destinationPath );

    // Zip the source file into the archive using the destination we have set up
    source.CopyTo( destination, true );

    source = new DiskFile( @ »C:\dir1\filex » );
    destinationPath = source.FullName.Substring( baseDir.Length );
    destination = zip.GetFile( destinationPath );
    source.CopyTo( destination, true );

    #2 The component currently has an issue where performance improvements are not applied to enough scenarios. We are working on the issue and it will be fixed in our next release schedules for November.

    #3 Indeed, Mono is not officially supported.

    Post count: 2

    Thanks for the response. Hope to see the higher performance in the new release soon.

3 sujets de 1 à 3 (sur un total de 3)
  • Vous devez être connecté pour répondre à ce sujet.