#include <net_config.h>
U16 tftp_fread (
FILE* file, /* Pointer to the file to read from. */
U8* buf, /* Pointer to buffer, to store the data. */
U16 len ); /* Number of bytes to read. */
Description
The tftp_fread reads len bytes from the file
identified by the file stream pointer in the function
argument. The argument buf is a pointer to the buffer where
the function stores the read data.
The tftp_fread function is in the TFTP_uif.c module. The
prototype is defined in net_config.h.
note
The tftp_fread function must read len bytes. The
TFTP Server stops reading and closes the TFTP session if the return
value is less than len bytes.
Return Value
The tftp_fread function returns the number of bytes read
from the file.
U16 tftp_fread (void *file, U8 *buf, U16 len) {
/* Read 'len' bytes from file to buffer 'buf'. Return number of bytes */
/* copied. The file will be closed, when the return value is < 'len' */
return (fread (buf, 1, len, file));
}
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.