NANDSafeClose

We do not recommend the use of this function. If possible, consider using the NANDSimpleSafe version of this function.

C Specification


#include <revolution/nand.h>

s32 NANDSafeClose(NANDFileInfo *info);

Arguments

info Pointer to the NANDFileInfo structure (opened by NANDSafeOpen[Async]).

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

Note: Because this function performs delete operations internally, it may potentially return NAND_RESULT_OPENFD. Nevertheless, NAND_RESULT_OPENFD is not returned as long as there are no illegal operations, such as the application program attempting to directly create a file below the /tmp/sys directory used by the NANDSafe functions.

Description

Closes a file. Files closed with this function must have been opened using NANDSafeOpen or NANDSafeOpenAsync. Appropriate permissions (both read and write) must be set for the parent directory of the file where the NANDSafe type of function is applied.

This function may put the current thread to sleep. For precautions when calling similar functions, refer to Interrupts and Callback Functions.

See Also

NANDSafeOpen, NANDSafeOpenAsync, NANDSafeCloseAsync, Interrupts and Callback Functions

Revision History

2007/09/25 Added information on the sleep status of threads.
2007/05/09 Noted that the use of this function is not recommended.
2007/02/xx Added a note for the result code NAND_RESULT_MAXDEPTH.
2006/11/30 Added NAND_RESULT_ALLOC_FAILED and NAND_RESULT_BUSY codes.
2006/9/8 Added a requirement for the parent directory permissions.
2006/08/30 Added the NAND_RESULT_OPENFD result code.
2006/08/15 Initial version.


CONFIDENTIAL