Metrologic Optimus S Programming Manual page 195

"c" programming guide
Table of Contents

Advertisement

9
10
appendln, read, readln, write, writeln
See Also
appendln
Purpose
To write a line (null-terminated string) to the bottom (EOF) of a DAT file.
Syntax
int appendln (int fd, char *buffer);
int fd;
char *buffer;
Example
appendln (fd, data_buffer);
Description
This routine writes a null-terminated string from the character array buffer to
the bottom of a DAT file (fd).
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, read, readln, write, writeln
chsize
Purpose
To extend or truncate a DAT file.
int chsize (int fd, long size);
Syntax
Chapter 3 Terminal Specific Function Library
The value of count is negative.
No free file space for file extension.
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 end-of-file position, and the file pointer
position is unaffected by the operation.
This routine will automatically extend the file size to hold the data written.
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.
/* file handle of the target DAT file */
/* pointer to a buffer where data is written to */
189

Advertisement

Table of Contents
loading

This manual is also suitable for:

Optimus r

Table of Contents