
PT-20 Programming Guide
9:The value of count is negative.
10:No more free file space for file extension.
Remove a null terminated character string from the top
(beginning-of-file position) of a DAT file.
int delete_topln(int fd);
The delete_topln function removes a line terminated by a null
character file until a null character (\0) or end-of-file is
encountered. The null character is also removed from the file.
Removing of data starts at the top (beginning-of-file position) of
the file, and the file pointer position is adjusted accordingly. The
delete_topln function will resize the file size automatically.
The delete_topln function returns the number of bytes actually
removed from the file (includes the null character). In case of
error, delete_topln 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.
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.
Check if file pointer of a DAT file reaches end of file.
if (eof(fd)) _puts(“end of file reached!\n”);
The eof function checks if the file pointer of the DAT file whose
file handle is specified in the argument fd, points to end-of-file.
The eof function returns an integer value of 1 to indicate an
end-of-file and a 0 when not. In case of error, eof returns an
integer value of -1 and an error code is set to the global variable
fErrorCode to indicate the error condition encountered.
2:File specified by DBF_fd does not exist.
8:File not opened
Commentaires sur ces manuels