LogRecordSequence Constructor (String, FileMode, FileAccess, FileShare, Int32, Int32)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Initializes a new instance of the LogRecordSequence class with a specified path to the log store, file permission, access and share modes, and the buffer size and count for records.

Namespace:   System.IO.Log
Assembly:  System.IO.Log (in System.IO.Log.dll)

public LogRecordSequence(
	string path,
	FileMode mode,
	FileAccess access,
	FileShare share,
	int bufferSize,
	int bufferCount
)

Parameters

path
Type: System.String

A relative or absolute path for the base file of the log store to open.

mode
Type: System.IO.FileMode

One of the FileMode values that determines how to open or create the store.

access
Type: System.IO.FileAccess

One of the FileAccess values that determines how the file can be accessed by the LogStore.

share
Type: System.IO.FileShare

One of the FileShare values that determines how the log store will be shared among processes.

bufferSize
Type: System.Int32

The desired buffer size in bytes. The buffer size determines the maximum size of the record that can be appended or read.

bufferCount
Type: System.Int32

The desired number of buffers.

Exception Condition
ArgumentNullException

path is null.

ArgumentException

path is an empty string ("").

-or-

path contains only white space.

-or-

path contains one or more invalid characters.

ArgumentOutOfRangeException

mode contains an invalid value.

FileNotFoundException

The file cannot be found.

IOException

An I/O error occurs when opening the log store.

UnauthorizedAccessException

Access for the specified log sequence is denied by the operating system.

NotSupportedException

This operation is not supported.

OutOfMemoryException

There is not enough memory to continue the execution of the program.

PlatformNotSupportedException

LogRecordSequence cannot be used because the required Common Log File System (CLFS) component is not installed. Install the CLFS component if it is available for your platform, or use the FileRecordSequence class.

This constructor initializes a new LogRecordSequence on a new LogStore object that it opens with the specified path, mode, and access. The store is opened sharing the specified access.

.NET Framework
Available since 3.0
Return to top
Show: