NANDSeek

C Specification


#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. In unit of 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 new position in the file if the seek is successful. If the seek fails, one of the following codes is returned:

NAND_RESULT_ACCESS
NAND_RESULT_INVALID
NAND_RESULT_UNKNOWN
NAND_RESULT_FATAL_ERROR

Description

Does a file seek. The start position of the next read/write is the offset plus whence. If the offset value is positive, the seek position moves from the base point to the end of the file. If the value is negative, the seek position moves from the base point toward the start of the file.

See Also

NANDSeekAsync, NANDRead, NANDReadAsync, NANDWrite, NANDWriteAsync

Revision History

06/16/2006 Initial version.