| Miles Sound System SDK 7.2a |
The function RAD_IOPQueueAsyncOpenFile asynchronously opens a file handle.
S32 RAD_IOPQueueAsyncOpenFile( RAD_IOP_ASYNC_OPEN_DATA *open_data ); |
Non-zero if the open was queued successfully, zero for failure.
This function queues up a file open to happen in the background. You fill out the name field, and optionally the group and callback fields, and then call this function.
The name field can be any normal PS2 formatted name ("cdrom0:\\MOVIES\\CREDITS.BIK;1" or "host:c:\\movies\\credits.bik").
You can check for completion using the callback, or just poll on the status field. If the status is set to RAD_IOP_STATUS_DONE, then the file_handle and size fields have been set correctly.
You should call RAD_IOPCloseFile to close any file handles opened with this function.
A file handle value can be one of four types:
1) A file on the host or the external hard drive, which is just the value returned from the IOP C runtime open function,
2) For CD or DVD files, it is basically the starting sector number (encoded with RAD_IOPGetFileHandleToLSN),
3) A pointer to IOP memory (encoded with RAD_IOPGetFileHandleToIOPMemory) - used to get data from IOP RAM,
4) A pointer to SPU memory (encoded with RAD_IOPGetFileHandleToSPUMemory) - used to get data from SPU RAM.
This function is required to get the first type of file handle, and it can also return the second type, by looking for the starting sector of a filename on the CD or DVD. But, if you already know the logical sector number of the file, RAD_IOPGetFileHandleToLSN is faster.
The open_data structure should remain valid until the operation is finished. That is, don't free the memory until the status is greater than or equal to RAD_IOP_STATUS_DONE.
Group:
The RAD_IOP API for the Sony PS2
Related Functions:
RAD_IOPCloseFile, RAD_IOPGetFileHandleToIOPMemory, RAD_IOPGetFileHandleToLSN, RAD_IOPGetFileHandleToSPUMemory, RAD_IOPQueueAsyncReadAtBottom, RAD_IOPQueueAsyncReadAtTop
Related Basic Types:
RAD_IOP_STATUS_VALUES, S32
Related Structures:
RAD_IOP_ASYNC_OPEN_DATA, RAD_IOP_ASYNC_READ_DATA
For technical support, e-mail Miles3@radgametools.com
© Copyright 1991-2007 RAD Game Tools, Inc. All Rights Reserved.