PROGRAMMER'S GUIDEFile system library
BackForward
File system library

8. Function specifications-3


8.3 Completion return type read


 List
 Title

Function specifications

 Function

Bulk reading of files

 Function Name

GFS_Load

 No

3.1 3.1

Form
Sint32 GFS_Load (Sint32 fid, Sint32 off, void * buf, Sint32 bsize)
input
 fid
 : File identifier
 off
 : Offset (sector unit)
 bsize
 : Upper limit of the number of data to be read (unit: bytes)
output
buf: Data read area
Function value
Number of data read (in bytes). Negative error code in case of error.
function
Read the data in the file by specifying the file identifier. Open and close processing is done inside this function.
If the size of the file is less than bsize, the data up to the end of the file will be read. If GFS_BUFSIZ_INF is specified for bsize, the data from the specified position to the end of the file will be read.
remarks
The buf must be placed on a 4-byte boundary. Default values are used for fetch mode, transfer mode, read parameters, and fetch parameters.

 List
 Title

Function specifications

 Function

Read data

 Function Name

GFS_Fread

 No

3.2

Form
Sint32 GFS_Fread (GfsHn gfs, Sint32 nsct, void * buf, Sint32 bsize)
input
 gfs
 : File handle
 nsct
 : Number of sectors to read
 bsize
 : Upper limit of the number of data to be read (unit: bytes)
output
buf: Read area
Function value
Number of bytes actually read
function
Specify the opened file handle to read the file data and perform the process.
Read the nsct sector data from the access pointer. Of the read data, the data up to bsize bytes is written to buf. The access pointer advances to the nsct sector.
remarks
There are restrictions on the buf address boundary depending on the transfer mode.
・ At the time of GFS_TMODE_SCU
 :No limit
・ At other times
 : Place on 4-byte boundary
Regardless of the value specified by GFS_SetReadPara, the default value is used for the read parameter.

BackForward
PROGRAMMER'S GUIDEFile system library
Copyright SEGA ENTERPRISES, LTD., 1997