FS_ReadFile


C Specification

#include <nitro/fs.h>

s32 FS_ReadFile( FSFile *p_file, void *dst, s32 len );

Description

This function reads a specified size of data from the file pointer's current position. If the specified size exceeds the end of the file, it will read to the end of the file and return that size.

Caution

This function cannot be called from the interrupt handler (IRQ mode). Note that the process may not be completed if interrupts are prohibited.

Arguments

p_file FSFile structure's address
dst Address of the storage destination buffer
len Length of the data to read in bytes

Return Values

If the data is correctly read, it returns the number of bytes. Otherwise it returns a value of -1.

See Also

FSFile, FS_OpenFile, FS_OpenFileFast, FS_CloseFile, FS_GetLength, FS_SeekFile, FS_SeekFileToBegin, FS_SeekFileToEnd

Revision History

09/24/2004 Added the description in the Caution section regarding the conditions for calling this function.
04/01/2004 Initial version