Metrologic Optimus S Programming Manual page 199

"c" programming guide
Table of Contents

Advertisement

filelength
Purpose
To get the length information of a DAT file.
Syntax
long filelength (int fd);
int fd;
Example
data_size = filelength (fd);
Description
This routine gets the size information (in bytes) of a DAT file (fd).
Return
If successful, it returns the number of bytes for file size.
On error, it returns -1L.
An error code is set to the global variable fErrorCode to indicate the error
condition encountered. Below are possible error codes and their interpretation.
Error Code
2
4
7
8
lseek
Purpose
To reposition the file pointer of a DAT file.
Syntax
long lseek (int fd, long offset, int origin);
int fd;
long offset;
int origin;
Example
lseek (fd, 512L, 0);
This routine reposition the file pointer of a DAT file (fd) by seeking a number
Description
of bytes (offset) from the given position origin.
The value of origin can be one of the three values:
1
0
-1
Return
If successful, it returns the number of bytes of offset.
On error, it returns -1L.
An error code is set to the global variable fErrorCode to indicate the error
condition encountered. Below are possible error codes and their interpretation.
Chapter 3 Terminal Specific Function Library
Interpretation
File specified by fd does not exist.
File specified by fd is not a DAT file.
Invalid file handle.
File not opened.
/* offset of new position (in bytes) from origin */
/* constant indicating the position from where to offset */
beginning of file
current file pointer position
end of file
/* file handle of the target DAT file */
/* file handle of the target DAT file */
/* skip 512 bytes */
193

Advertisement

Table of Contents
loading

This manual is also suitable for:

Optimus r

Table of Contents