Mono Class Library: Mono.Unix.Native.Stdlib Overview | Members

Mono.Unix.Native.Stdlib.fread Method

Read from a binary stream. [Edit]

[System.CLSCompliant(false)]
public static ulong fread (void* ptr, ulong size, ulong nmemb, IntPtr stream)

Parameters

ptr
Where to store the binary data read. [Edit]
size
The size of each object to read. [Edit]
nmemb
The number of objects to read. [Edit]
stream
The binary FILE stream to read from. [Edit]

Returns

The function fread() advances the file position indicator for the stream by the number of bytes read. It returns the number of objects read or written. If an error occurs, or the end-of-file is reached, the return value is a short object count (or zero).

The function fread() does not distinguish between end-of-file and error, and callers must use Stdlib.feof(3) and Stdlib.ferror(3) to determine which occurred.

[Edit]

Remarks

The function fread() reads nmemb objects, each size bytes long, from the stream pointed to by stream, storing them at the location given by ptr. [Edit]

Requirements

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