FileSystemTarExtensions
Extension methods for IFileSystem and streams to work with TAR archives.
メソッド
public static IEnumerable<ValueTuple<string, Stream>> Untar(byte[] input, Func<string, bool> filter)
result = FileSystemTarExtensions.Untar(input, filter)
Extracts entries from a TAR archive contained in the specified byte array.
- input
- The byte array containing the TAR archive.
- filter
- A function to filter entries by name. Only entries returning true will be processed.
戻り値: An enumerable of entries. The enumerator must be disposed after use (foreach does this automatically).
public static IEnumerable<ValueTuple<string, Stream>> Untar(Stream input, bool leaveOpen, Func<string, bool> filter)
result = FileSystemTarExtensions.Untar(input, leaveOpen, filter)
Extracts entries from a TAR archive contained in the specified stream.
- input
- The stream containing the TAR archive.
- leaveOpen
- Whether to leave the underlying stream open after processing.
- filter
- A function to filter entries by name. Only entries returning true will be processed.
戻り値: An enumerable of entries. The enumerator must be disposed after use (foreach does this automatically).
public static IEnumerable<ValueTuple<string, Stream>> Untar(IFileSystem fs, string tarPath, Func<string, bool> filter)
result = FileSystemTarExtensions.Untar(fs, tarPath, filter)
Opens a TAR archive file and returns its entries as streams.
- fs
- The file system to use.
- tarPath
- Path to the TAR archive file.
- filter
- Optional filter function for entry names.
戻り値: An enumerable of entries. The enumerator must be disposed after use (foreach does this automatically).
public static void UntarTo(IFileSystem fs, string tarPath, string destPath, bool overwrite)
FileSystemTarExtensions.UntarTo(fs, tarPath, destPath, overwrite)
Extracts a TAR archive to the specified directory.
- fs
- The file system to use.
- tarPath
- Path to the TAR archive file.
- destPath
- Destination directory path.
- overwrite
- Whether to overwrite existing files.
public static void UntarTo(IFileSystem fs, Stream tarStream, string destPath, bool overwrite)
FileSystemTarExtensions.UntarTo(fs, tarStream, destPath, overwrite)
Extracts a TAR archive stream to the specified directory.
- fs
- The file system to use.
- tarStream
- Stream containing the TAR archive.
- destPath
- Destination directory path.
- overwrite
- Whether to overwrite existing files.
public static Task UntarToAsync(IFileSystem fs, string tarPath, string destPath, bool overwrite, CancellationToken cancellationToken)
result = FileSystemTarExtensions.UntarToAsync(fs, tarPath, destPath, overwrite, cancellationToken)
Extracts a TAR archive to the specified directory asynchronously.
- fs
- The file system to use.
- tarPath
- Path to the TAR archive file.
- destPath
- Destination directory path.
- overwrite
- Whether to overwrite existing files.
- cancellationToken
- A cancellation token.
public static Task UntarToAsync(IFileSystem fs, Stream tarStream, string destPath, bool overwrite, CancellationToken cancellationToken)
result = FileSystemTarExtensions.UntarToAsync(fs, tarStream, destPath, overwrite, cancellationToken)
Extracts a TAR archive stream to the specified directory asynchronously.
- fs
- The file system to use.
- tarStream
- Stream containing the TAR archive.
- destPath
- Destination directory path.
- overwrite
- Whether to overwrite existing files.
- cancellationToken
- A cancellation token.
public static IEnumerable<ValueTuple<string, Stream>> Untgz(Stream input, bool leaveOpen, Func<string, bool> filter)
result = FileSystemTarExtensions.Untgz(input, leaveOpen, filter)
Extracts entries from a GZip-compressed TAR archive (.tar.gz) contained in the specified stream.
- input
- The stream containing the .tar.gz archive.
- leaveOpen
- Whether to leave the underlying stream open after processing.
- filter
- A function to filter entries by name. Only entries returning true will be processed.
戻り値: An enumerable of entries. The enumerator must be disposed after use (foreach does this automatically).
public static IEnumerable<ValueTuple<string, Stream>> Untgz(IFileSystem fs, string tgzPath, Func<string, bool> filter)
result = FileSystemTarExtensions.Untgz(fs, tgzPath, filter)
Opens a GZip-compressed TAR archive file (.tar.gz or .tgz) and returns its entries as streams.
- fs
- The file system to use.
- tgzPath
- Path to the .tar.gz archive file.
- filter
- Optional filter function for entry names.
戻り値: An enumerable of entries. The enumerator must be disposed after use (foreach does this automatically).
public static void UntgzTo(IFileSystem fs, string tgzPath, string destPath, bool overwrite)
FileSystemTarExtensions.UntgzTo(fs, tgzPath, destPath, overwrite)
Extracts a GZip-compressed TAR archive (.tar.gz or .tgz) to the specified directory.
- fs
- The file system to use.
- tgzPath
- Path to the .tar.gz archive file.
- destPath
- Destination directory path.
- overwrite
- Whether to overwrite existing files.
public static void UntgzTo(IFileSystem fs, Stream tgzStream, string destPath, bool overwrite)
FileSystemTarExtensions.UntgzTo(fs, tgzStream, destPath, overwrite)
Extracts a GZip-compressed TAR archive stream (.tar.gz) to the specified directory.
- fs
- The file system to use.
- tgzStream
- Stream containing the .tar.gz archive.
- destPath
- Destination directory path.
- overwrite
- Whether to overwrite existing files.
public static Task UntgzToAsync(IFileSystem fs, string tgzPath, string destPath, bool overwrite, CancellationToken cancellationToken)
result = FileSystemTarExtensions.UntgzToAsync(fs, tgzPath, destPath, overwrite, cancellationToken)
Extracts a GZip-compressed TAR archive (.tar.gz or .tgz) to the specified directory asynchronously.
- fs
- The file system to use.
- tgzPath
- Path to the .tar.gz archive file.
- destPath
- Destination directory path.
- overwrite
- Whether to overwrite existing files.
- cancellationToken
- A cancellation token.
public static Task UntgzToAsync(IFileSystem fs, Stream tgzStream, string destPath, bool overwrite, CancellationToken cancellationToken)
result = FileSystemTarExtensions.UntgzToAsync(fs, tgzStream, destPath, overwrite, cancellationToken)
Extracts a GZip-compressed TAR archive stream (.tar.gz) to the specified directory asynchronously.
- fs
- The file system to use.
- tgzStream
- Stream containing the .tar.gz archive.
- destPath
- Destination directory path.
- overwrite
- Whether to overwrite existing files.
- cancellationToken
- A cancellation token.