This topic demonstrates how to remove items from a GZipped Tar archive by retrieving a reference to a file contained within. Note: Tar and FileSystem-based GZip are not currently available in Xceed's .NET Compact Framework products.
To remove an item from a GZipped Tar archive, the following steps must be performed:
When performing many operations on an archive, you may wish to consider optimizing your code by using batch updates.
Using a non-GZipped Tar archive may be preferable in some situations, for example, when read/write speed is essential but storage space is not, when you need to access individual files in the Tar archive without uncompressing the entire archive, or when the files inside the Tar archive are already compressed.
Setting the LicenseKey property with Tar also unlocks the GZip capabilities.
This example demonstrates how to remove a file from within a GZipped Tar archive.
VB.NET | Copy Code |
---|---|
|
C# | Copy Code |
---|---|
|
VB.NET | Copy Code |
---|---|
|
C# | Copy Code |
---|---|
|
The main questions you should ask yourself when removing items from a Tar archive are:
Do you want to filter (specify specific files and folders) the items that are to be deleted? Use filters.
Do you want to display the status of the operation? See the Events topic.
Do you want to remove a specific folder? Create an instance of a TarredFolder rather than a TarredFile object
Do you already have a reference on a folder? Use the GetFile or GetFolder methods method to retrieve a reference on the file or folder to remove.