Click or drag to resize

CachedFileStream(String, FileMode, FileSystemRights, FileShare, Int32, FileOptions) Constructor

Initializes a new instance of the FileStream class with the specified path, creation mode, access rights and sharing permission, the buffer size, and additional file options.

Namespace: GSF.IO
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.218-beta+101eee949414e414795e55a6e73d88938f0177b8
Syntax
public CachedFileStream(
	string path,
	FileMode mode,
	FileSystemRights rights,
	FileShare share,
	int blockSize,
	FileOptions options
)
View Source

Parameters

path  String
A relative or absolute path for the file that the current FileStream object will encapsulate.
mode  FileMode
A constant that determines how to open or create the file.
rights  FileSystemRights
A constant that determines the access rights to use when creating access and audit rules for the file.
share  FileShare
A constant that determines how the file will be shared by processes.
blockSize  Int32
A positive Int32 value greater than 0 indicating the block size. For blockSize values between one and eight, the actual block size is set to eight bytes.
options  FileOptions
A constant that specifies additional file options.
Exceptions
ExceptionCondition
ArgumentNullExceptionpath is null.
ArgumentExceptionpath is an empty string (""), contains only white space, or contains one or more invalid characters. -or-path refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in an NTFS environment.
NotSupportedExceptionpath refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in a non-NTFS environment.
ArgumentOutOfRangeExceptionblockSize is negative or zero.-or- mode, access, or share contain an invalid value.
FileNotFoundExceptionThe file cannot be found, such as when mode is FileMode.Truncate or FileMode.Open, and the file specified by path does not exist. The file must already exist in these modes.
PlatformNotSupportedExceptionThe current operating system is not Windows NT or later.
IOExceptionAn I/O error, such as specifying FileMode.CreateNew when the file specified by path already exists, occurred. -or-The stream has been closed.
SecurityExceptionThe caller does not have the required permission.
DirectoryNotFoundExceptionThe specified path is invalid, such as being on an unmapped drive.
UnauthorizedAccessExceptionThe access requested is not permitted by the operating system for the specified path, such as when access is Write or ReadWrite and the file or directory is set for read-only access. -or-Encrypted is specified for options, but file encryption is not supported on the current platform.
PathTooLongExceptionThe specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
See Also