Example: Please refer to “GetFilePositionByNo()” for more detailed
information.
GetFilePositionByNo()
Function: Uses the file number to read the file position.
Syntax:
char far *GetFilePositionByNo(int no);
Header: #include
”7188xc.h”
Description: The address can be used to get the file data.
no: The file index (The first file is index 0).
Return Value: On success, returns the starting address of the file.
On error, returns NULL.
Note
: If the file size is > 64K-16, a huge pointer (char huge *) data
type must be used to retrieve the file data for the offset.
Example:
#include ”7188xc.h”
static FILE_DATA far *fdata; /*file_data structure, please see the file.c
for details*/
char far *fp_no;
void main()
{
int fileno,i;
char fname[13];
InitLib(); /*Initialize the Library*/
fileno=GetFileNo(); /*get file number*/
Print("Total file number=%d\n\r",fileno);
fname[12]=0;
for(i=0;i<fileno;i++){
fdata=GetFileInfoByNo(i); /*get file information using the file
number*/
if(fdata) {
GetFileName(i,fname); /*get file name*/
Print("[%02d]:%-12s start at %Fp "
"%02d/%02d/%04d %02d:%02d:%02d size=%lu\n\r", i,fname,
fdata->addr,fdata->month,fdata->day,(fdata->year)+1980,
fdata->hour,fdata->minute,fdata->sec*2,fdata->size);
}
}
for(i=0;i<fileno;i++){
fp_no=(char far *)GetFilePositionByNo(i); /*get file position*/
I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) ---
129
Содержание I-7188XC Series
Страница 87: ...I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 87...
Страница 136: ...I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 136...
Страница 142: ...Step 8 Make the project I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 142...
Страница 149: ...Step 8 Rebuild the project I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 149...