The BetterStreams Class Library
AlternateStreams Class
Namespaces > BetterStreams > AlternateStreams
The AlternateStreams class provides static methods for manipulating alternate streams in NTFS files.
Syntax
C#Visual BasicManaged C++
public static class AlternateStreams
Public NotInheritable Class AlternateStreams
public ref class AlternateStreams abstract sealed
Members
All MembersConstructorsMethodsPropertiesFieldsEvents



IconMemberDescription
static memberDeleteStream(String, String)
Deletes an alternate stream.

static memberGetStreamNames(String)
Returns a string array of the names of all the alternate streams in an NTFS file.

static memberGetStreamNames(String, Int64[]())
Returns a string array of the names of all the alternate streams in an NTFS file.

static memberOpenStream(String, String)
Opens an alternate stream or, if it does not exist, creates it, with both read and write access and read-only sharing (other processes may read the stream but not alter it).

static memberOpenStream(String, String, FileMode)
Opens or creates an alternate stream with the specified mode, read and write access and read-only sharing (other processes may read the stream but not alter it).

static memberOpenStream(String, String, FileAccess, FileShare)
Opens an alternate stream or, if it does not exist, creates it, with the specified access and sharing.

static memberOpenStream(String, String, FileMode, FileAccess)
Opens or creates an alternate stream with the specified mode, access, and read-only sharing (other processes may read the stream but not alter it).

static memberOpenStream(String, String, FileMode, FileAccess, FileShare)
Opens or creates an alternate stream with the specified mode, access, and sharing.

Remarks

Under NTFS a file has a default "main" stream as well as zero or more "alternate" streams. These can be used to store arbitrary data; one example (that uses Microsoft's proprietary OLE Structured Storage format) is the shell's summary information (viewable in Windows Explorer's Properties dialog under the "Summary" tab), which is stored as an alternate stream named ((char)5 + "SummaryInformation").

When using alternate streams, be aware that if the file is moved to a non-NTFS filesystem, the alternate streams will be permanently lost (there are some exceptions, e.g. an alternate-stream-aware backup application may preserve the streams' data and recreate them when restoring the backup). Additionally, many applications (such as Windows Explorer) will not display a file's alternate streams nor include them when calculating file size, which can be potentially be confusing or misleading for end-users.

Inheritance Hierarchy
Object
AlternateStreams

Assembly: BetterStreams (Module: BetterStreams) Version: 1.0.0.0