U_RWR - re-write a record in a UFAS file.

Usage:

#include <ufas.h>
nbytes = u_rwr( record, length, fp[, relkey] );

Where:

char *record;
is the pointer to the new record to write.
int length;
is the number of bytes in the new record to be written. This length must match that of the record to be overwritten.
U_FILE fp;
specifies the file to write to.
unsigned relkey;
is the Relative key of the record to be re-written for Relative files open for Random or Dynamic access.
int nbytes;
is the number of bytes actually written, or EOF if an error occurs. Note that this may be larger than "length" if the latter is smaller than the fixed record length for the file.

Description:

"u_rwr" re-writes a record in the named file.

If the file is open for Sequential access, the record obtained by the last call to "u_gxt" is re-written. Otherwise, the record specified by the given Relative key (for Relative files), or the Prime Key in the record (for Indexed and ISP files) is written. The error return is taken if a record having that key value does not already exist in the file.

Notes:

The fourth argument must only be provided for Relative files.

Copyright © 1996, Thinkage Ltd.