#include <revolution/nand.h> #define NAND_MAX_NAME 12 s32 NANDReadDir(const char *dirName, char *nameList, u32 *num);
| dirName | Directory name. |
|---|---|
| nameList | Buffer start address for storing a list of the files and directories contained in the specified directory. This buffer must be 32-byte aligned. No list is stored if NULL is specified. |
| num | When nameList is NULL, the number of files and directories contained in dirName will be stored in *num. When a buffer address (non-NULL) is given for nameList, the file and directory names are written to the nameList buffer with the value of *num as the upper limit. The number of files and directories that were actually gotten from dirName is stored in *num. |
Returns one of the following codes.
NAND_RESULT_OK
NAND_RESULT_ACCESS
NAND_RESULT_ALLOC_FAILED
NAND_RESULT_BUSY
NAND_RESULT_INVALID
NAND_RESULT_NOEXISTS
NAND_RESULT_UNKNOWN
NAND_RESULT_FATAL_ERROR
Gets a list of files and directories contained in the specified directory. If the list size is unknown, retrieve the list using the following steps.
NULL specified as the second argument. The number of elements in the list will be written to the memory region indicated by num.
(Number of elements) * (NAND_MAX_NAME+1) rounded up to a multiple of 32 bytes.
This function may put the current thread to sleep. For precautions when calling similar functions, refer to Interrupts and Callback Functions.
NANDReadDirAsync, Interrupts and Callback Functions
2007/09/25 Added information about the sleep status of threads.
2007/06/xx The description of the third argument was revised because it was insufficient.
2006/11/30 Added the NAND_RESULT_ALLOC_FAILED and NAND_RESULT_BUSY codes.
2006/09/07 Added text about allocating memory of a size rounded up to a multiple of 32 bytes.
2006/06/16 Initial version.
CONFIDENTIAL