CARDRead

C Specification

#include <revolution/card.h>

#define CARD_READ_SIZE      512
s32 CARDRead(CARDFileInfo* fileInfo, void* buf, s32 length, s32 offset);

Arguments

fileInfo Pointer to the file information of the file to read. fileInfo must be valid file information that was initialized using the CARD[Fast]Open or CARDCreate[Async] function.
buf Buffer address (32-byte alignment).
length Number of bytes to be read (multiple of CARD_READ_SIZE).
offset File position at which to start the read (multiple of CARD_READ_SIZE).

Return Values

One of the following codes:

CARD_RESULT_FATAL_ERROR
CARD_RESULT_NOCARD
CARD_RESULT_BUSY
CARD_RESULT_NOFILE
CARD_RESULT_NOPERM
CARD_RESULT_LIMIT
CARD_RESULT_CANCELED
CARD_RESULT_READY

Description

Reads data from a file synchronously.

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

See Also

CARD[Fast]Open
CARDCreate[Async]
CARDCancel()
CARDGetResultCode()

Revision History

2007/09/25 Added information on the sleep status of threads.
2006/03/01 Initial version.


CONFIDENTIAL