Export (0) Print
Expand All

LogStore Constructor (String, FileMode, FileAccess, FileShare, FileSecurity)

Initializes a new instance of the LogStore class.

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

public LogStore(
	string path,
	FileMode mode,
	FileAccess access,
	FileShare share,
	FileSecurity fileSecurity
)

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.

fileSecurity
Type: System.Security.AccessControl.FileSecurity

One of the FileSecurity value that specifies the security to set on the newly created store if the store must be created.

ExceptionCondition
ArgumentNullException

path is null.

ArgumentException

The log store file name specified by path is not valid.

-or-

Mode is CreateNew, which cannot be used without write access.

-or-

Mode is OpenOrCreate, which cannot be used without write access.

ArgumentOutOfRangeException

mode contains an invalid value.

-or

access contains an invalid value.

-or-

share contains an invalid value.

FileNotFoundException

The file cannot be found.

IOException

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

The file specified by path cannot be accessed because it is in use by another process.

-or-

The file specified by path cannot be created because the file or directory already exists.

-or-

The log handle could not be bound to the thread pool.

-or-

The specified log file format or version is invalid.

PlatformNotSupportedException

LogStore 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 instead.

ObjectDisposedException

The method was called after the sequence has been disposed of.

OutOfMemoryException

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

SequenceFullException

The record sequence is full.

UnauthorizedAccessException

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

This constructor initializes a new LogStore object that it opens with the specified path, mode, and access. The store is opened sharing the specified access. The path parameter should follow the following syntax:

log:<physical log name>[::<log client name>]

where <physical log name> is a valid path to a log file, and <log client name> is a unique client identifier. A log store should be either a physical log store or a virtual log store, but not both. Once a log store has been created physically or virtually, it remains so for its lifetime. A physical log store is created by specifying only the physical log name. A virtual log store is created by specifying both the physical log name and the log client name.

Clients that share the same physical log name share the same extents collection and policy.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft