Metrologic Optimus S Programming Manual page 204

"c" programming guide
Table of Contents

Advertisement

198
"C" Programming Guide For Optimus S/R
write (fd, data_buffer);
Example
Description
This routine writes a null-terminated string from the character array buffer to a
DAT file (fd).
Characters are written to the file until a null character (\0) is encountered.
The null character is also written to the file.
Writing of data starts at the current file pointer position, which is
incremented accordingly when the operation is completed.
If end-of-file is encountered during operation, this routine will
automatically extend the file size to hold the data written.
Return
If successful, it returns the number of bytes actually written to the file,
including the null character.
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
10
11
See Also
append, appendln, read, readln, write
Interpretation
File specified by fd does not exist.
File specified by fd is not a DAT file.
Invalid file handle.
File not opened.
No free file space for file extension.
Cannot find string terminator in buffer.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Optimus r

Table of Contents