Metrologic Optimus S Programming Manual page 202

"c" programming guide
Table of Contents

Advertisement

196
"C" Programming Guide For Optimus S/R
tell
If characters are read until a null character (\0) is encountered. The null
character is also read into buffer, that is, it is also counted for the return
value. Otherwise, there may not be a null character stored in buffer.
Reading of data starts at the current position of the file pointer, which is
incremented accordingly when the operation is completed.
The argument max_count is usually set to a value which equals the size of
the character array buffer to avoid string overflow.
Return
If successful, it returns the number of bytes actually read from the file.
On error, it returns -1.
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
9
read, write, writeln
See Also
To get the current file pointer position of a DAT file.
Purpose
Syntax
long tell (int fd);
int fd;
current_position = tell (fd);
Example
Description
This routine gets the current file pointer position of a DAT file (fd).
The file pointer position is expressed in number of bytes from the
beginning of file. For example, if the file pointer points to the beginning of
file, its position will be 0L.
Return
If successful, it returns the number of bytes for the current file pointer.
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
18
Interpretation
File specified by fd does not exist.
File specified by fd is not a DAT file.
Invalid file handle.
File not opened.
The value of max_count is negative.
/* file handle of the target DAT file */
Interpretation
File specified by fd does not exist.
File specified by fd is not a DAT file.
Invalid file handle.
File not opened.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Optimus r

Table of Contents