Class TarFile
Provides static methods for extracting tar files and tarballs.
Inheritance
System.Object
TarFile
Namespace: GDX.IO.Compression
Syntax
public static class TarFile
Methods
| Improve this Doc View SourceExtractStream(Stream, String)
Extract a tar formatted System.IO.Stream to the destinationDirectoryName
.
Declaration
public static void ExtractStream(Stream sourceStream, string destinationDirectoryName)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | sourceStream | The System.IO.Stream which to extract from. |
System.String | destinationDirectoryName | Output directory to write the files. |
ExtractToDirectory(String, String, Boolean)
Extracts all the files in the specified tar/tarball to a directory on the file system.
Declaration
public static void ExtractToDirectory(string sourceArchiveFileName, string destinationDirectoryName, bool forceGZipDataFormat = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | sourceArchiveFileName | The path to the archive that is to be extracted. |
System.String | destinationDirectoryName | The path to the directory in which to place the extracted files, specified as a relative or absolute path. A relative path is interpreted as relative to the current working directory. |
System.Boolean | forceGZipDataFormat | Enforce inflating the file via a System.IO.Compression.GZipStream. |
Examples
A synchronous approach to extracting the contents of a file, to a folder:
TarFile.ExtractToDirectory("C:\Temp\DownloadCache.tar.gz", "C:\Saved");