ColdC: Function/Method Reference: fread()


STRING|BUFFER fread([INTEGER block])

Read from the existing file bound to this object. If the file is a binary file, a buffer is returned. If the file is a text file (default), a string is returned.

If the file is at the end, the ~eof error is thrown.

With binary files an optional block size may be specified. The default block size is 512 characters.

Example:

while ((line = (| fread() |)) != ~eof)
    log(line);


Last Modified on Mar 2 1996
Copyright © 1995, 1996, Brandon Gillespie