Mono Class Library: Mono.Unix.StdioFileStream Overview | Members

Mono.Unix.StdioFileStream Constructor

Creates a Mono.Unix.StdioFileStream type, wrapping the existing unmanaged FILE pointer fileStream with the specified file access.

public StdioFileStream (IntPtr fileStream, System.IO.FileAccess access, bool ownsHandle)

Parameters

fileStream
A IntPtr containing a FILE pointer
access
A System.IO.FileAccess value that determins how the file may be accessed by the Mono.Unix.StdioFileStream object. This parameter is used to specify the initial values of the System.IO.Stream.CanRead and System.IO.Stream.CanWrite properties.
ownsHandle
A bool specifying whether or not the created Mono.Unix.StdioFileStream instance "owns" fileStream.

Exceptions

TypeReason
ArgumentExceptionfileStream is an invalid FILE pointer.

Remarks

If ownsHandle is true, then fileStream will be closed via Mono.Unix.Native.Stdlib.fclose when StdioFileStream.Close is invoked (which is also called from the finalizer and from the IDisposable implementation). Otherwise, fileStream will only be flushed on StdioFileStream.Close and not actually closed.

Requirements

Namespace: Mono.Unix
Assembly: Mono.Posix (in Mono.Posix.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0