Skip to content

ArchiveFileInfo Class

Abstract object representing a compressed file within an archive; provides operations for getting the file properties and unpacking the file.

MethodDescription
CopyTo(destFileName)Extracts the file.
CopyTo(destFileName, overwrite)Extracts the file, optionally overwriting any existing file.
Delete()Deletes the file. NOT SUPPORTED.
GetObjectData(info, context)Sets the SerializationInfo with information about the archive.
OpenRead()Opens the archive file for reading without actually extracting the file to disk.
OpenText()Opens the archive file reading text with UTF-8 encoding without actually extracting the file to disk.
Refresh()Refreshes the attributes and other cached information about the file, by re-reading the information from the archive.
Refresh(newFileInfo)Refreshes the information in this object with new data retrieved from an archive.
ToString()Gets the full path to the file.
PropertyDescription
ArchiveGets or sets the archive that contains this file.
ArchiveNameGets the full path of the archive that contains this file.
ArchiveNumberGets the number of the archive where this file starts.
AttributesGets the attributes of the file.
ExistsChecks if the file exists within the archive.
FullNameGets the full path to the file.
LastWriteTimeGets the last modification time of the file.
LengthGets the uncompressed size of the file.
NameGets the name of the file.
PathGets the internal path of the file in the archive.
WixToolset.Dtf.Compression.dll version 5.0.0+41e11442b2ca93e444b60213b5ae99dcbab787d8

Extracts the file.

public void CopyTo(
string destFileName
)
ParameterTypeDescription
destFileNamestringThe destination path where the file will be extracted.

Extracts the file, optionally overwriting any existing file.

public void CopyTo(
string destFileName,
bool overwrite
)
ParameterTypeDescription
destFileNamestringThe destination path where the file will be extracted.
overwriteboolIf true, will be overwritten if it exists.
ExceptionDescription
T:System.IO.IOExceptionis false
and exists. |

Deletes the file. NOT SUPPORTED.

public void Delete()
ExceptionDescription
T:System.NotSupportedExceptionFiles cannot be deleted
from an existing archive. |

Sets the SerializationInfo with information about the archive.

public void GetObjectData(
System.Runtime.Serialization.SerializationInfo info,
System.Runtime.Serialization.StreamingContext context
)
ParameterTypeDescription
infoSystem.Runtime.Serialization.SerializationInfoThe SerializationInfo that holds the serialized object data.
contextSystem.Runtime.Serialization.StreamingContextThe StreamingContext that contains contextual information about the source or destination.

Opens the archive file for reading without actually extracting the file to disk.

public System.IO.Stream OpenRead()

System.IO.Stream A stream for reading directly from the packed file. Like any stream this should be closed/disposed as soon as it is no longer needed.

Opens the archive file reading text with UTF-8 encoding without actually extracting the file to disk.

public System.IO.StreamReader OpenText()

System.IO.StreamReader A reader for reading text directly from the packed file. Like any reader this should be closed/disposed as soon as it is no longer needed.

To open an archived text file with different encoding, use the «see M:WixToolset.Dtf.Compression.ArchiveFileInfo.OpenRead» method and pass the returned stream to one of the «see T:System.IO.StreamReader» constructor overloads.

Refreshes the attributes and other cached information about the file, by re-reading the information from the archive.

public void Refresh()

Refreshes the information in this object with new data retrieved from an archive.

protected void Refresh(
ArchiveFileInfo newFileInfo
)
ParameterTypeDescription
newFileInfoArchiveFileInfoFresh instance for the same file just read from the archive.

Subclasses may override this method to refresh sublcass fields. However they should always call the base implementation first.

Gets the full path to the file.

public string ToString()

string The same as «see P:WixToolset.Dtf.Compression.ArchiveFileInfo.FullName»

Gets or sets the archive that contains this file.

public ArchiveInfo Archive { get; set; }

Gets the full path of the archive that contains this file.

public string ArchiveName { get; set; }

Gets the number of the archive where this file starts.

public int ArchiveNumber { get; set; }

A single archive or the first archive in a chain is numbered 0.

Gets the attributes of the file.

public System.IO.FileAttributes Attributes { get; set; }

Checks if the file exists within the archive.

public bool Exists { get; set; }

Gets the full path to the file.

public string FullName { get; set; }

For example, the path "C:\archive.cab\file.txt" refers to a file “file.txt” inside the archive “archive.cab”.

Gets the last modification time of the file.

public System.DateTime LastWriteTime { get; set; }

Gets the uncompressed size of the file.

public System.Int64 Length { get; set; }

Gets the name of the file.

public string Name { get; set; }

Gets the internal path of the file in the archive.

public string Path { get; set; }