NANDCountNumOpenableFiles

Syntax

#include <revolution/nand.h>

s32 NANDCountNumOpenableFiles( u8 *number, BOOL *cleaning );

Arguments

number The number of files that can be opened.
cleaning The result of deleting files used for counting by internal processes. If successful, TRUE is stored. If the process fails, FALSE is stored.

Return Values

Returns one of the following codes.

NAND_RESULT_OK
NAND_RESULT_ACCESS
NAND_RESULT_ALLOC_FAILED
NAND_RESULT_BUSY
NAND_RESULT_CORRUPT
NAND_RESULT_INVALID
NAND_RESULT_OPENFD
NAND_RESULT_UNKNOWN
NAND_RESULT_FATAL_ERROR

Description

Gets the number of files that can be opened. If the return value is anything other than NAND_RESULT_OK, the processing of count-use files has failed. When that occurs, the value stored in number (the number of files that can be opened) might not be correct.

If cleaning is FALSE, the deletion of the count-use files under /tmp has failed. Even after the process ends there might be as many as 16 inodes being consumed under /tmp. When the application reboots, the system automatically deletes the count-use files. Because the files are created under /tmp/count_tmpdir, the application can also delete these files. However, this function is for debugging purposes, so you do not need to perform error processing.

Because this function is used for debugging applications, it works only with the debug version library. It does not work with the release version library, where NAND_RESULT_FATAL_ERROR is always the return value.The purpose of this function is to troubleshoot why NAND_RESULT_MAXFD is returned when the NAND application has several content files, system files, and middleware files open (including some the developer may be unaware of). This refers to files opened by the system and by middleware.

This function sometimes puts the current thread to sleep, so it cannot be called from callback functions. For precautions when calling similar functions, see Interrupts and Callback Functions.

See Also

Interrupts and Callback Functions

Revision History

2009/07/22 Initial version.


CONFIDENTIAL