blob: bd78f3fc26760c05f98b02860267938116ed6222 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
.TH FREAD 3S
.CT 2 file_io
.SH NAME
fread, fwrite \(mi buffered binary input/output
.SH SYNOPSIS
.B #include <stdio.h>
.PP
.B int fread(ptr, sizeof(*ptr), nitems, stream)
.br
.SM
.B FILE
.B *stream;
.PP
.B int fwrite(ptr, sizeof(*ptr), nitems, stream)
.br
.SM
.B FILE
.B *stream;
.SH DESCRIPTION
.I Fread
reads from the named input
.IR stream
at most
.I nitems
of data of the type of
.I *ptr
into a block beginning at
.I ptr.
It returns the number of items actually read.
.PP
.I Fwrite
appends to the named output
.I stream
at most
.I nitems
of data of the type of
.I *ptr
from a block beginning at
.I ptr.
It returns the number of items actually written.
.SH "SEE ALSO"
.IR read (2),
.IR stdio (3)
.SH DIAGNOSTICS
.I Fread
and
.I fwrite
return 0
upon end of file or error.
.SH BUGS
Write errors of the data for any
.I fwrite
call may occur a long time after that call.
.br
These routines are much slower than you might imagine.
|