Home

Traffic Server Software Developers Kit

INKfread

Reads a specified number of bytes from a file to a buffer.

Prototype

int INKfread (INKFile filep, void *buf, int length)

Arguments

filep is the file to read from.

buf is the buffer to read into.

length is the amount of data to read.

Description

Attempts to read length bytes of data from the file pointed to by filep into the buffer buf. If the file was not opened for reading, then INKfread returns -1. If an error occurs while reading the file, then INKfread returns -1. If the end of the file is reached, then INKfread returns 0; otherwise, INKfread returns the number of bytes read.

Example

See the example for INKfopen