NANDSeek

Syntax

#include <revolution/nand.h>

#define NAND_SEEK_SET          0
#define NAND_SEEK_CUR          1
#define NAND_SEEK_END          2

s32 NANDSeek(NANDFileInfo *info, s32 offset, s32 whence);

Arguments

info Pointer to a NANDFileInfo structure.
offset Specifies the offset value. The size is given in bytes.
whence Specifies the seek base position.
NAND_SEEK_SET Start of file.
NAND_SEEK_CUR Current position of file.
NAND_SEEK_END End of file.

Return Values

Returns the seek target position when seek is successful. When seek fails, one of the following codes is returned:

NAND_RESULT_ACCESS
NAND_RESULT_ALLOC_FAILED
NAND_RESULT_BUSY
NAND_RESULT_INVALID
NAND_RESULT_UNKNOWN
NAND_RESULT_FATAL_ERROR

Description

Performs file seek. The start position of the next read/write is the location obtained by adding the value of offset to the base point specified by the whence argument. If the offset value is positive, the seek position moves from the base point to the file's end. If the value is negative, the seek position moves from the base point toward the file's start.

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

See Also

NANDSeekAsync, NANDRead, NANDReadAsync, NANDWrite, NANDWriteAsync, Interrupts and Callback Functions

Revision History

2007/09/25 Added information about the sleep status of threads.
2006/11/30 Added the NAND_RESULT_ALLOC_FAILED and NAND_RESULT_BUSY codes.
2006/06/16 Initial version.


CONFIDENTIAL