[Overview][Constants][Types][Procedures and functions][Index] Reference for unit 'amigados' (#aros)


Reads a line from the specified input (buffered)


Source position: amigados.pas line 2299

function FGets(

  Fh: BPTR;

  Buf: STRPTR;

  BufLen: LongWord





filehandle to use for buffered I/O



Area to read bytes into.



Number of bytes to read, must be > 0.

Function result

Pointer to buffer passed in, or nil for immediate EOF or for an error. If nil is returnd for an EOF, IoErr() will return 0.


This routine reads in a single line from the specified input stopping at a NEWLINE character or EOF. In either event, UP TO the number of len specified bytes minus 1 will be copied into the buffer. Hence if a length of 50 is passed and the input line is longer than 49 bytes, it will return 49 characters. It returns the buffer pointer normally, or NULL if EOF is the first thing read.

If terminated by a newline, the newline WILL be the last character in the buffer. This is a buffered read routine. The string read in IS null-terminated.

See also



Reads a number of blocks from an input (buffered)



Writes a string the the specified output



Read a character from the specified input (buffered)

Documentation generated on: 2017-01-10