Japanese
PROGRAMMER'S GUIDEFile system library
BackForward
file system library

8.Function specification-3


8.3 Read with return completion


 one
View
table
 Title

function specification

 Function

Batch loading files

 Function name

GFS_Load

 No

3.1

Format
Sint32 GFS_Load(Sint32 fid, Sint32 off, void *buf, Sint32 bsize)
input
 fid
 :File identifier
 off
 : Offset (in sector units)
 bsize
 : Upper limit of number of data to read (unit: bytes)
output
buf: data reading area
function value
Number of data read (in bytes). Negative error code in case of error.
function
Reads data from a file by specifying the file identifier. Opening and closing processing is done inside this function.
If the file size is less than bsize, data up to the end of the file is read. If you specify GFS_BUFSIZ_INF for bsize, data from the specified position to the end of the file will be read.
remarks
buf must be aligned on a 4-byte boundary. Default values are used for retrieval mode, transfer mode, read parameters, and retrieval parameters.

 one
View
table
 Title

function specification

 Function

Loading data

 Function name

GFS_Fread

 No

3.2

Format
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 number of data to read (unit: bytes)
output
buf: Read area
function value
Number of bytes actually read
function
Reads and processes file data by specifying the opened file handle.
Read the nsct sector data from the access pointer. Of the read data, up to bsize bytes are written to buf. The access pointer advances nsct sectors ahead.
remarks
There are restrictions on buf address boundaries depending on the transfer mode.
・When GFS_TMODE_SCU
 :No limit
・Other times
 :Align on 4-byte boundary
Regardless of the value specified in GFS_SetReadPara, the default value will be used for the read parameter.

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