
74
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
10:No more free file space for file extension.
11:Can not find string treminator in buf.
chsize
Purpose
:
Extends or truncates a DAT file.
Syntax
:
int chsize(int fd, long new_size);
Example call
:
if (chsize(fd, 0)) _puts(“file truncated!\n”);
Includes
:
#include “LIB_CL.h ”
Description
:
The chsize function truncates or extends the file specified by the
argument fd to match the new file length in bytes given in the
argument new_size. If the file is truncated, all data beyond the
new file size will be lost. If the file is extended, no initial value is
filled to the newly extended area.
Returns
:
If chsize successfully changes the file size of the specified DAT
file, it returns an integer value of 1. In case of error, chsize will
return an integer value of 0 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
10:No more free file space for file extension.
close
Purpose
:
Close a DAT file.
Syntax
:
int close(int fd);
Example call
:
If (close(fd)) _puts(“file closed!\n”);
Includes
:
#include “LIB_CL.h ”
Description
:
Close a previously opened or created DAT file whose file handle
is fd.
Returns
:
close returns an integer value of 1 to indicate success. In case of
error, close returns an integer value of 0 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.
Содержание 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 ...