NANDSimpleSafeClose

Syntax

#include <revolution/nand.h>

s32 NANDSimpleSafeClose(NANDFileInfo *info);

Arguments

info (Pointer to the NANDFileInfo structure (opened by the NANDSimpleSafeOpen[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 due to internal operations. However, NAND_RESULT_OPENFD will not be returned if the application does not perform an illegal operation, such as directly access files under the /tmp/sys directory used by NANDSimpleSafe-related functions.

Description

Closes a file in a manner that guarantees the atomic nature of file updates. Files closed using this function must have been opened using either the NANDSimpleSafeOpen or NANDSimpleSafeOpenAsync function. Appropriate permissions (both read and write) must be set for the parent directory of the file to which NANDSimpleSafe-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

NANDSimpleSafeOpen, NANDSimpleSafeOpenAsync, NANDSimpleSafeCloseAsync, NANDSimpleSafeCancel, NANDSimpleSafeCancelAsync, 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 Initial version.


CONFIDENTIAL