File System File System
File System File System
DocFX + Singulink = ♥

Search Results for

    Method OpenAsyncHandle

    OpenAsyncHandle(FileMode, FileAccess, FileShare, FileOptions, long)

    Opens an asynchronous handle to a new or existing file, for use with the methods of RandomAccess (the Asynchronous option is always appended).

    Declaration
    SafeFileHandle OpenAsyncHandle(FileMode mode = FileMode.Open, FileAccess access = FileAccess.ReadWrite, FileShare share = FileShare.None, FileOptions options = FileOptions.None, long preallocationSize = 0)
    Parameters
    Type Name Description
    FileMode mode

    A FileMode constant specifying the mode (for example, Open or Append) in which to open the file.

    FileAccess access

    A FileAccess constant specifying whether to open the file with Read, Write, or ReadWrite file access.

    FileShare share

    A FileShare constant specifying the type of access other handles have to this file.

    FileOptions options

    Additional file options.

    long preallocationSize

    The initial allocation size in bytes for the file. Must be at least zero.

    Returns
    Type Description
    SafeFileHandle

    A new SafeFileHandle to the opened file.

    Remarks

    Note that the underlying operating system might not support asynchronous I/O, so the handle might be opened synchronously depending on the platform.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    preallocationSize is negative, or mode, access, share or options is not a valid value.

    ArgumentException

    The combination of mode, access and preallocationSize is not valid, such as a mode that creates a file together with read-only access.

    © Singulink. All rights reserved.