Return to previous page Return to menu Go to next page

(1) Immediate return access to a single file

For single file access, GFS_NwExecOne is a server function.
The following is an example of a program that accesses one file in an immediate return type. In this example, GFS_NwFread is the request function.

 [Example]
#define BUF_SIZE  2048*2

GfsHn gfs; / * File handle * / Sint32 nsct = 2; / * Number of read sectors * / Sint32 stat; / * Server status * / Uint32 buf [BUF_SIZE / 4]; / ​​* Reading area * /

gfs = GFS_Open (fid); / * Open file * / / * Request function * / GFS_NwFread (gfs, nsct, buf, BUF_SIZE); / * Read nsct sector to buf * /                                         / * Immediate return * /

for (;;) {      / * Server function * /      stat = GFS_NwExecOne (gfs); / * Execution of reading * /      if (stat == GFS_SVR_COMPLETED) {/ * Reading complete? * /           break;      }      user (); / * Arbitrary user processing * / }

GFS_Close (gfs); / * File close * /



Return to previous page Return to menu Go to next page