fileread() - reads file into buffer
int fileread(f,buf,size)
FILE *f;
char *buf;
int size;
fileread() reads up to size bytes from the file into buf. The number actually
read may be smaller if end-of-file is reached. The file pointer (implied) is
left pointing to one past the last character read.
- > 0
- the number of bytes actually read.
- = 0
- file was at end-of-file.
- < 0
- error code.
It returns the number of bytes actually read or an error code.
The buffer must be at least size long. If reading from a "raw" device,
size must be a multiple of 512.