BSD 4_2 development
[unix-history] / usr / man / man3 / fread.3s
CommitLineData
f0c63b06
C
1.TH FREAD 3S "19 January 1983"
2.UC 4
3.SH NAME
4fread, fwrite \- buffered binary input/output
5.SH SYNOPSIS
6.B #include <stdio.h>
7.PP
8.B fread(ptr, sizeof(*ptr), nitems, stream)
9.br
10.SM
11.B FILE
12.B *stream;
13.PP
14.B fwrite(ptr, sizeof(*ptr), nitems, stream)
15.br
16.SM
17.B FILE
18.B *stream;
19.SH DESCRIPTION
20.I Fread
21reads, into a block beginning at
22.IR ptr ,
23.I nitems
24of data of the type of
25.I *ptr
26from the named input
27.IR stream .
28It returns the number of items actually read.
29.PP
30If
31.I stream
32is
33.B stdin
34and the standard output is line buffered, then any partial output line
35will be flushed before any call to
36.IR read (2)
37to satisfy the
38.IR fread .
39.PP
40.I Fwrite
41appends at most
42.I nitems
43of data of the type of
44.I *ptr
45beginning at
46.I ptr
47to the named output
48.IR stream .
49It returns the number of items actually written.
50.SH "SEE ALSO"
51read(2),
52write(2),
53fopen(3S),
54getc(3S),
55putc(3S),
56gets(3S),
57puts(3S),
58printf(3S),
59scanf(3S)
60.SH DIAGNOSTICS
61.I Fread
62and
63.I fwrite
64return
650
66upon end of file or error.