
PT-20 Programming Guide
2:File specified by fd does not exist.
8:File not opened
10:No more free file space for file extension.
If (close(fd)) _puts(“file closed!\n”);
Close a previously opened or created DAT file whose file handle
is fd.
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.
2:File specified by fd does not exist.
8:File not opened
Remove a specified number of bytes from top (beginning-of-file
position) of a DAT file.
int delete_top(int fd, int count);
The delete_top function removes the number of bytes specified in
the argument count from a DAT file whose file handle is fd.
Removing of data starts at the beginning-of-file position of the
file. The file pointer position is adjusted accordingly by the
operation. For instance, if initially the file pointer points to the
tenth character, after removing 8 character from the file, the new
file pointer will points to the second character of the file.
The delete_top function will resize the file size automatically.
The delete_top function returns the number of bytes actually
removed from the file. In case of error, delete_top 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.
2:File specified by fd does not exist.
8:File not opened
Komentarze do niniejszej Instrukcji