NAnt SDK Documentation - v0.92 |

# ExpandBaseTask.ExtractFile Method

Extracts a file entry from the specified stream.

[Visual Basic]
Protected Sub ExtractFile( _
ByVal inputStream As Stream, _
ByVal destDirectory As String, _
ByVal entryName As String, _
ByVal entryDate As Date, _
ByVal entrySize As Long _
)
[C#]
protected void ExtractFile(
Stream inputStream,
string destDirectory,
string entryName,
DateTime entryDate,
long entrySize
);

#### Parameters

inputStream
  The Stream containing the compressed entry.
destDirectory
  The directory where to store the expanded file.
entryName
  The name of the entry including directory information.
entryDate
  The date of the entry.
entrySize
  The uncompressed size of the entry.

#### Remarks

We cannot rely on the fact that the directory entry of a given file is created before the file is extracted, so we should create the directory if it doesn't yet exist.

#### Exceptions

Exception Type | Condition
--- | ---
BuildException | The destination directory for the entry could not be created. -or- The entry could not be extracted.

#### See Also

ExpandBaseTask Class | NAnt.Compression.Tasks Namespace