# FS_ReadDir

## C Specification

  `#include <nitro/fs.h>`
  `BOOL FS_ReadDir( FSFile *p_dir, FSDirEntry *p_entry );`

## Arguments

p_dir | Address of the `FSFile` structure
p_entry | The `FSDirEntry` structure's address

## Return Values

If there is a remaining directory entry, this function will acquire the remaining directory entry, and return a value of TRUE.
If this function arrives at the end of the directory list, it will return a value of FALSE.

## Description

This function acquires the next directory entry from the specified directory list. Each time the next directory entry is acquired, the directory list position is incremented by one. When the directory list arrives at the end, this function will return a value of FALSE starting with the next call. For example, after you use the `FS_FindDir` function to open a directory that contains three files. When you call this function using that directory list, it will return a value of TRUE three times. It will return a value of FALSE during the fourth time.

## Note

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`, `FSDirEntry`, `FS_FindDir`, `FS_TellDir`, `FS_SeekDir`, `FS_RewindDir`

## Revision History

09/24/2004 Added the description in the Caution section regarding the conditions for calling this function.
04/08/2004 Revised description due to the integration of `FSDir` and `FSFile`.
04/01/2004 Initial Version