BSD 4_4 development
[unix-history] / usr / share / man / cat3 / fread.0
FREAD(3) BSD Programmer's Manual FREAD(3)
N\bNA\bAM\bME\bE
f\bfr\bre\bea\bad\bd, f\bfw\bwr\bri\bit\bte\be - binary stream input/output
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
#\b#i\bin\bnc\bcl\blu\bud\bde\be <\b<s\bst\btd\bdi\bio\bo.\b.h\bh>\b>
_\bi_\bn_\bt
f\bfr\bre\bea\bad\bd(_\bv_\bo_\bi_\bd _\b*_\bp_\bt_\br, _\bs_\bi_\bz_\be_\b__\bt _\bs_\bi_\bz_\be, _\bs_\bi_\bz_\be_\b__\bt _\bn_\bm_\be_\bm_\bb, _\bF_\bI_\bL_\bE _\b*_\bs_\bt_\br_\be_\ba_\bm);
_\bi_\bn_\bt
f\bfw\bwr\bri\bit\bte\be(_\bv_\bo_\bi_\bd _\b*_\bp_\bt_\br, _\bs_\bi_\bz_\be_\b__\bt _\bs_\bi_\bz_\be, _\bs_\bi_\bz_\be_\b__\bt _\bn_\bm_\be_\bm_\bb, _\bF_\bI_\bL_\bE _\b*_\bs_\bt_\br_\be_\ba_\bm);
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
The function f\bfr\bre\bea\bad\bd() reads _\bn_\bm_\be_\bm_\bb objects, each size bytes long, from the
stream pointed to by _\bs_\bt_\br_\be_\ba_\bm, storing them at the location given by _\bp_\bt_\br.
The function f\bfw\bwr\bri\bit\bte\be() writes _\bn_\bm_\be_\bm_\bb objects, each _\bs_\bi_\bz_\be bytes long, to the
stream pointed to by _\bs_\bt_\br_\be_\ba_\bm, obtaining them from the location given by
_\bp_\bt_\br.
R\bRE\bET\bTU\bUR\bRN\bN V\bVA\bAL\bLU\bUE\bES\bS
The functions f\bfr\bre\bea\bad\bd() and f\bfw\bwr\bri\bit\bte\be() advance the file position indicator
for the stream by the number of bytes read or written. They return the
number of objects read or written. If an error occurs, or the end-of-
file is reached, the return value is a short object count (or zero).
The function f\bfr\bre\bea\bad\bd() does not distinguish between end-of-file and error,
and callers must use feof(3) and ferror(3) to determine which occurred.
The function f\bfw\bwr\bri\bit\bte\be() returns a value less than _\bn_\bm_\be_\bm_\bb only if a write er-
ror has occurred.
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
read(2), write(2)
S\bST\bTA\bAN\bND\bDA\bAR\bRD\bDS\bS
The functions f\bfr\bre\bea\bad\bd() and f\bfw\bwr\bri\bit\bte\be() conform to ANSI C X3.159-1989 (``ANSI
C '').
4.4BSD June 4, 1993 1