Return to previous page Return to menu Go to next page

5. Access method

There are the following two access methods provided by this library.

5.1 Complete return type access

Completion return type access is a method similar to the standard C library file access function.
The following is an example program for completion return type access.

 [Example]
#define BUF_SIZE 2048

GfsHn gfs; / * File handle * / Sint32 fid; / * File identifier * / Sint32 nsct = 1; / * Number of read sectors * / Uint32 buf [BUF_SIZE / 4]; / ​​* Reading area * /

gfs = GFS_Open (fid); / * Open file * /

GFS_Fread (gfs, nsct, buf, BUF_SIZE); / * Read nsct sector to buf * /

GFS_Close (gfs); / * File close * /

5.2 Immediate return access

Immediate return access is performed using the request function and server function. The request function executes only the request acceptance process and returns immediately. The actual access process is performed by repeatedly calling the server function while monitoring the input completion status. You can also process the application in the server function call loop. For a file handle that has issued a request, the request cannot be issued until the access process is completed.


Return to previous page Return to menu Go to next page