
73
Purpose
:
Write a specified number of bytes to bottom (end-of-file position)
of a DAT file.
Syntax
:
int append(int fd, char *buffer, int count);
Example call
:
append(fd,”ABCDE”,5);
Includes
:
#include “LIB_CL.h ”
Description
:
The append function writes the number of bytes specified in the
argument count from the character array buffer to the bottom of a
DAT file whose file handle is fd. Writing of data starts at the
end-of-file position of the file, and the file pointer position is
unaffected by the operation. The append function will
automatically extend the file size of the file to hold the data
written.
Returns
:
The append function returns the number of bytes actually written
to the file. In case of error, append returns an integer value of -1
and an error code is set to the global variable fErrorCode to
indicate the error condition encountered. Possible error codes and
their interpretation are listed below.
fErrorCode
:
2 File specified by fd does not exist.
8 File not opened
9 The value of count is negative.
10 No more free file space for file extension.
appendln
Purpose
:
Write a null terminated character string to the bottom
(end-of-file position) of a DAT file.
Syntax
:
int appendln(int fd, char *buffer);
Example call
:
appendln(fd, data_buffer);
Includes
:
#include “LIB_CL.h ”
Description
:
The appendln function writes a null terminated character string
from the character array buffer to a DAT file whose file handle is
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 end-of-file position. The file pointer position
is unaffected by the operation. The appendln function will
automatically extend the file size of the file to hold the data
written.
Returns
:
The appendln function returns the number of bytes actually
written to the file (includes the null character). In case of error,
appendln returns an integer value of -1 and an error code is set to
Содержание PT-10
Страница 4: ...3 Keyboard Wedge 99 System 101 Power 102 Other 102 ...
Страница 13: ...12 6 Development Flow Chart ...
Страница 53: ...52 Returns No returns Notes ...