FPUTR - write record to file.

(GCOS-8 Only)

Usage:

#include <stdio.h>
#include <host_io.h>
i = fputr( buf, length, f[, media, report] );

Where:

char *buf;
points to an area of memory from which the record will be written.
size_t length;
is the number of bytes to write out. A length of zero is never valid. "length" must be a multiple of four except for media codes 4 and 6. For Media 2, "length" must be 56; for Media 10, "length" must be 80.
FILE *f;
is the file to which the record should be written.
int media;
is an optional argument giving a media code. If this is not specified, the default is 6.
int report;
is an optional argument giving a report code. If this is not specified, the default is 00.
int i;
is the number of bytes written out if the write was successful. If an error occurs, a -1 is returned.

Description:

"fputr" writes a logical record to the specified file from the memory area that "buf" points to.

Known Bugs:

You cannot use "fputr" in combination with "fputc" and friends. If you do, the results will be unpredictable.

"fputr" doesn't enforce the media code restrictions given for "length". However, if your "length" value is invalid, you will write a file that may not be readable by other programs.

Copyright © 1996, Thinkage Ltd.