Bewerken

Share via


TarFile.CreateFromDirectory Method

Definition

Overloads

CreateFromDirectory(String, Stream, Boolean)

Creates a tar stream that contains all the filesystem entries from the specified directory.

CreateFromDirectory(String, String, Boolean)

Creates a tar file that contains all the filesystem entries from the specified directory.

CreateFromDirectory(String, Stream, Boolean)

Source:
TarFile.cs
Source:
TarFile.cs
Source:
TarFile.cs

Creates a tar stream that contains all the filesystem entries from the specified directory.

public:
 static void CreateFromDirectory(System::String ^ sourceDirectoryName, System::IO::Stream ^ destination, bool includeBaseDirectory);
public static void CreateFromDirectory (string sourceDirectoryName, System.IO.Stream destination, bool includeBaseDirectory);
static member CreateFromDirectory : string * System.IO.Stream * bool -> unit
Public Shared Sub CreateFromDirectory (sourceDirectoryName As String, destination As Stream, includeBaseDirectory As Boolean)

Parameters

sourceDirectoryName
String

The path of the directory to archive.

destination
Stream

The destination stream for the archive.

includeBaseDirectory
Boolean

true to include the base directory name as the first segment in all the names of the archive entries. false to exclude the base directory name from the archive entry names.

Exceptions

sourceDirectoryName or destination is null.

sourceDirectoryName is empty.

-or-

destination does not support writing.

The sourceDirectoryName directory path is not found.

An I/O exception occurred.

Applies to

CreateFromDirectory(String, String, Boolean)

Source:
TarFile.cs
Source:
TarFile.cs
Source:
TarFile.cs

Creates a tar file that contains all the filesystem entries from the specified directory.

public:
 static void CreateFromDirectory(System::String ^ sourceDirectoryName, System::String ^ destinationFileName, bool includeBaseDirectory);
public static void CreateFromDirectory (string sourceDirectoryName, string destinationFileName, bool includeBaseDirectory);
static member CreateFromDirectory : string * string * bool -> unit
Public Shared Sub CreateFromDirectory (sourceDirectoryName As String, destinationFileName As String, includeBaseDirectory As Boolean)

Parameters

sourceDirectoryName
String

The path of the directory to archive.

destinationFileName
String

The path of the destination archive file.

includeBaseDirectory
Boolean

true to include the base directory name as the first path segment in all the names of the archive entries. false to exclude the base directory name from the entry name paths.

Exceptions

sourceDirectoryName or destinationFileName is null.

sourceDirectoryName or destinationFileName is empty.

The sourceDirectoryName directory path is not found.

An I/O exception occurred.

Applies to