m2m_fs_read

UINT32 m2m_fs_read(M2M_T_FS_HANDLE filehandle, CHAR *buf, UINT32 length)

 

Description: the function reads data from an already opened in suitable mode, refer to m2m_fs_open (...).

 

Parameters:

filehandle:     file handle

buf:             pointer to the allocated buffer that will be filled with characters read from the current

 file data pointer.

length:          number of characters to be read from the file. If two consecutive readings are performed,

the last one starts from the file data pointer left by the first reading plus 1. If the length parameter forces the reading over the size of the file, the reading stops automatically when the EOF is reached, (EOF = -1).     

 

 

Return value:

         on success:   the number of characters read is equal to length value.
         on failure:     if the number of character read is less than the length value, an

error could be happened. In this case, call the m2m_fs_last_error(...) API. 

 

Output data:
         on success:   the allocated buffer filled with the characters read from the file.

 

 

NOTE: m2m_fs_last_error function returns the failure reason.