NANDSafeClose

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

Syntax

#include <revolution/nand.h>

s32 NANDSafeClose(NANDFileInfo *info);

Arguments

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

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: It is possible that this function may return NAND_RESULT_OPENFD because it performs deletion operations internally. However, NAND_RESULT_OPENFD will not be returned if the application does not perform an illegal operation, such as directly create files under the /tmp/sys directory used by NANDSafe-related functions.

Description

Closes a file. Files closed using this function must have been opened using either the NANDSafeOpen or NANDSafeOpenAsync function. Appropriate permissions (both read and write) must be set for the parent directory of the file to which NANDSafe-related functions are applied.

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

This function updates the FAT of the Wii console NAND memory.

See Also

NANDSafeOpen, NANDSafeOpenAsync, NANDSafeCloseAsync, Interrupts and Callback Functions

Revision History

2008/04/23 Commented about updating the FAT.
2007/09/25 Added information about 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 NAND_RESULT_OPENFD result code.
2006/11/30 Added the NAND_RESULT_ALLOC_FAILED and NAND_RESULT_BUSY codes.
2006/09/08 Added a requirement for the parent directory permissions.
2006/08/30 Added the NAND_RESULT_OPENFD result code.
2006/08/15 Initial version.


CONFIDENTIAL