public class DiskFileSystem : FileSystem, IDiskCompatibleFileSystem
Shows how to use FileSystem.TransferFiles method to add files from the default Disk File System to a Zip file system.
using ComponentPro.Compression; using ComponentPro.IO; ... // Create a new instance. Zip zip = new Zip(); // Open an existing archive. zip.Open("test.zip"); // Transfer files and directories from the zip file system to another file system. In this example we will use DiskFileSystem. TransferOptions opt = new TransferOptions(); // Copy just .exe and .dll that with size greater than 50kb. opt.SearchCondition = new NameSearchCondition("*.exe;*.dll") + new SizeSearchCondition(50 * 1024, long.MaxValue); // Copy files from the zip file system to a directory on the disk file system. FileSystem.TransferFiles(zip, "", false, null, DiskFileSystem.Default, @"c:\temp", opt); // Close the zip file. zip.Close();
Shows how to use FileSystem.TransferFiles method to copy files from the Disk File System.
using ComponentPro.Compression; using ComponentPro.IO; ... // Create a new instance. Zip zip = new Zip(); // Create a new zip file. zip.Create("test.zip"); // Transfer files and directories from another file system. In this example we will use DiskFileSystem. TransferOptions opt = new TransferOptions(); // Copy just .dat and .dll files. opt.SearchCondition = new NameSearchCondition("*.dat;*.dll"); // Copy files from the default disk file system to the current working directory on the zip file system. FileSystem.TransferFiles(DiskFileSystem.Default, @"c:\temp", false, null, zip, "", opt); // Close the zip file. zip.Close();