OpenFileReadStream Method (path, attributes, lastWriteTime)

Microsoft Deployment Tools

Deployment Tools Foundation OpenFileReadStream Method (path, attributes, lastWriteTime)
Deployment Tools Foundation NamespacesMicrosoft.Deployment.CompressionArchiveFileStreamContextOpenFileReadStream(String, FileAttributes%, DateTime%)
Opens a stream to read a file that is to be included in an archive.
Declaration Syntax
C# Visual Basic Visual C++
public virtual Stream OpenFileReadStream(
	string path,
	out FileAttributes attributes,
	out DateTime lastWriteTime
)
Public Overridable Function OpenFileReadStream ( _
	path As String, _
	<OutAttribute> ByRef attributes As FileAttributes, _
	<OutAttribute> ByRef lastWriteTime As DateTime _
) As Stream
public:
virtual Stream^ OpenFileReadStream(
	String^ path, 
	[OutAttribute] FileAttributes% attributes, 
	[OutAttribute] DateTime% lastWriteTime
)
Parameters
path (String)
The path of the file within the archive.
attributes ( FileAttributes %)
The returned attributes of the opened file, to be stored in the archive.
lastWriteTime ( DateTime %)
The returned last-modified time of the opened file, to be stored in the archive.
Return Value
A readable Stream where the file bytes will be read from before they are compressed, or null to skip inclusion of the file and continue to the next file.
Remarks
This method opens a file using the following logic: If the Directory and the Files mapping are both null, the path is treated as relative to the current directory, and that file is opened.If the Directory is not null but the Files mapping is null, the path is treated as relative to that directory, and that file is opened.If the Directory is null but the Files mapping is not null, the path parameter is used as a key into the mapping, and the resulting value is the file path that is opened, relative to the current directory (or it may be an absolute path). If no mapping exists, the file is skipped.If both the Directory and the Files mapping are specified, the path parameter is used as a key into the mapping, and the resulting value is the file path that is opened, relative to the specified directory (or it may be an absolute path). If no mapping exists, the file is skipped.

Assembly: Microsoft.Deployment.Compression (Module: Microsoft.Deployment.Compression) Version: 3.0.0.0 (3.5.1623.0)