Mono Class Library: Mono.Unix.Native.Stdlib Overview | MembersMono.Unix.Native.Stdlib.fgets Method |
Read a line from a FILE stream. [Edit]
|
Upon successful completion, returns sb. If end-of-file occurs before any characters are read, returns null and the contents of sb remains unchanged. If an error occurs, null is returned and the contents of sb are indeterminate. fgets does not distinguish between end-of-file and error, and callers must use Stdlib.feof(3) and Stdlib.ferror(3) to determine which occurred.
Usage
The following errors are specified:
Error Details Errno.EBADF The given stream is not a readable stream. fgetpos may also fail for any of the error specified for the routines Stdlib.fflush(3), Syscall.fstat(2), Syscall.read(2), or Stdlib.malloc(3).
[Edit]
The fgets() function reads at most one less than the number of characters specified by size from the given stream and stores them in the string sb. Reading stops when a newline character is found, at end-of-file or error. The newline, if any, is retained. If any characters are read and there is no error, a '\0' character is appended to end the string. [Edit]
Namespace: Mono.Unix.Native
Assembly: Mono.Posix (in Mono.Posix.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0