BSD 3 development
[unix-history] / usr / man / man3 / fread.3s
CommitLineData
e6817382
BJ
1.TH FREAD 3S
2.SH NAME
3fread, fwrite \- buffered binary input/output
4.SH SYNOPSIS
5.B #include <stdio.h>
6.PP
7.B fread(ptr, sizeof(*ptr), nitems, stream)
8.br
9.SM
10.B FILE
11.B *stream;
12.PP
13.B fwrite(ptr, sizeof(*ptr), nitems, stream)
14.br
15.SM
16.B FILE
17.B *stream;
18.SH DESCRIPTION
19.I Fread
20reads, into a block beginning at
21.I ptr,
22.I nitems
23of data of the type of
24.I *ptr
25from the named input
26.IR stream .
27It returns the number of items actually read.
28.PP
29.I Fwrite
30appends at most
31.I nitems
32of data of the type of
33.I *ptr
34beginning at
35.I ptr
36to the named output
37.IR stream .
38It returns the number of items actually written.
39.SH "SEE ALSO"
40read(2), write(2),
41fopen(3),
42getc(3), putc(3),
43gets(3), puts(3),
44printf(3), scanf(3)
45.SH DIAGNOSTICS
46.I Fread
47and
48.I fwrite
49return
500
51upon end of file or error.