NANDSetStatus

C Specification


#include <revolution/nand.h>

s32 NANDSetStatus( const char *path, const NANDStatus *stat );

Arguments

path Specifies the path of the target file or directory.
stat Pointer to a NANDStatus structure.

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_NOEXISTS
NAND_RESULT_NOTEMPTY
NAND_RESULT_UNKNOWN
NAND_RESULT_FATAL_ERROR

Description

Sets the status of the specified file or directory. This operation cannot be performed if the file or directory has an owner ID that is different from the owner ID of the application. If this operation is performed on a file, the file size must be zero.Permission can be specified with the permission member variable of the NANDStatus structure. However, at a minimum the file or directory must be granted the NAND_PERM_OWNER_READ permission.If NAND_PERM_OWNER_READ permission is not granted, the function will return NAND_RESULT_INVALID.

If this function is used on the home directory, the permissions will be initialized by the system when the application restarts. In order to avoid problems caused by the initialization of permissions, do not use this function on the home directory.

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

See Also

NANDStatus, NANDGetStatus, NANDGetStatusAsync, NANDSetStatusAsync, Interrupts and Callback Functions

Revision History

2007/12/10 Added a mention of the fact that the permissions for the home directory will be initialized by the system upon restarting.
2007/09/25 Added information on the sleep status of threads.
2006/11/30 Added NAND_RESULT_ALLOC_FAILED and NAND_RESULT_BUSY codes.
2006/11/13 Added explanation about the need to grant NAND_PERM_OWNER_READ permission.
2006/11/13 Deleted the section about restrictions on file size.
2006/06/16 Initial version.


CONFIDENTIAL