# FS_ReadFile

## C Specification

  `#include <nitro/fs.h>`
  `s32 FS_ReadFile( FSFile *p_file, void *dst, s32 len );`

## Arguments

p_file | Address of the `FSFile` structure
dst | Address of the storage destination buffer
len | Byte length of data being read

## Return Values

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

## 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.
When using the `ROM Archive` to read Game Card data, also refer to the description for the `CARD_ReadRomAsync` function.

## Caution

This function cannot be called from the interrupt handler (IRQ mode).
Also note that in some cases processing may not end if interrupts are left prohibited.

## See Also

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

## Revision History

08/28/2005 Added links to `CARD_ReadRomAsync` function in description.
09/24/2004 Added text under Caution regarding the conditions for calling and completing this function.
04/01/2004 Initial version.