C# Class Tar.Tar

A class to create, list, or extract TAR archives. This is the primary, central class for the Tar library.
Bugs: does not read or write bzip2 compressed tarballs (.tar.bz2) uses Marshal.StructureToPtr and thus requires a LinkDemand, full trust.d
Mostrar archivo Open project: robertbaker/SevenUpdate Class Usage Examples

Private Properties

Property Type Description
AddSymlink void
InternalCreateArchive void
InternalGetExtractOutputStream Stream
InternalGetInputStream Stream
InternalGetOutputArchiveStream Stream
InternalListOrExtract List
ListOrExtract List

Public Methods

Method Description
AddDirectory ( string dirName, string parent = null ) : void

Adds a directory to the tar archive

AddFile ( string fullName, string directory = null ) : void

Adds a file to the tar Archive

CreateArchive ( string outputFile, IEnumerable filesOrDirectories, Options options = null ) : void

Create a tar archive with the given name, and containing the given set of files or directories, and using GZIP compression by default.

Extract ( string archive, string extractDirectory, Options options = null ) : ReadOnlyCollection

Extract the named tar archive to a specified directory

List ( string archive ) : ReadOnlyCollection

Get a list of the TarEntry items contained within the named archive.

Private Methods

Method Description
AddSymlink ( string name ) : void

Adds a symbolic link to a Tar archive

InternalCreateArchive ( string outputFile, IEnumerable files ) : void
InternalGetExtractOutputStream ( string name, string extractDirectory ) : Stream
InternalGetInputStream ( string archive ) : Stream
InternalGetOutputArchiveStream ( string filename ) : Stream
InternalListOrExtract ( string archive, string extractDirectory, bool wantExtract ) : List
ListOrExtract ( string archive, string extractDirectory, bool wantExtract, Options options ) : List

Method Details

AddDirectory() public method

Adds a directory to the tar archive
public AddDirectory ( string dirName, string parent = null ) : void
dirName string The path to the directory
parent string
return void

AddFile() public method

Adds a file to the tar Archive
public AddFile ( string fullName, string directory = null ) : void
fullName string The file to add to the archive
directory string
return void

CreateArchive() public static method

Create a tar archive with the given name, and containing the given set of files or directories, and using GZIP compression by default.
public static CreateArchive ( string outputFile, IEnumerable filesOrDirectories, Options options = null ) : void
outputFile string The name of the tar archive to create. The file must not exist at the time of the call.
filesOrDirectories IEnumerable A list of filenames and/or directory names to be added to the archive.
options Options The options to use during Tar operation.
return void

Extract() public static method

Extract the named tar archive to a specified directory
public static Extract ( string archive, string extractDirectory, Options options = null ) : ReadOnlyCollection
archive string The name of the tar archive to extract.
extractDirectory string The directory to extract the archive
options Options A set of options for extracting.
return ReadOnlyCollection

List() public static method

Get a list of the TarEntry items contained within the named archive.
public static List ( string archive ) : ReadOnlyCollection
archive string The name of the tar archive.
return ReadOnlyCollection