Your Browser is not longer supported
Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...
{{viewport.spaceProperty.prod}}
fdelrec - delete record in ISAM file (BS2000)
&pagelevel(4)&pagelevel
Syntax | #include <stdio.h> int fdelrec(FILE *stream, void *key); |
Description fdelrec()
deletes the record with the key value key from an ISAM file with record I/O.
| FILE *stream is the file pointer of an ISAM file that was opened in the mode type=record ,
forg=key (see also fopen() , freopen() ). void *key is a pointer to an area which contains the key value of the record to be deleted in its complete length or null. If key is equal to null, the last record read is deleted. The record must be read immediately before the fdelrec call. |
Return val. | 0 > 0 EOF | if successful. The record with the specified key was deleted. The record to be deleted does not exist. if an error occurs. |
Notes | If the call was error-free (return values 0 or > 0) the EOF flag of the file is reset. If the specified key value is not present in the file (return value > 0) the current position of the file position indicator remains unchanged. Sole exception: if, at the time of the fdelrec call, the file is positioned on the second or higher key of a group of records with identical keys, then fdelrec() positions the file on the first record after this group. In ISAM files with key duplication, fdelrec() deletes the first record with the specified key. The file is then positioned on the next record (with the same key or the next higher key). |
See also | flocate() , fopen() , freopen() , stdio.h . |