Commit | Line | Data |
---|---|---|
c12abad4 DR |
1 | .TH FREAD 3S |
2 | .SH NAME | |
3 | fread, 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 | |
20 | reads, into a block beginning at | |
21 | .I ptr, | |
22 | .I nitems | |
23 | of data of the type of | |
24 | .I *ptr | |
25 | from the named input | |
26 | .IR stream . | |
27 | It returns the number of items actually read. | |
28 | .PP | |
29 | .I Fwrite | |
30 | appends at most | |
31 | .I nitems | |
32 | of data of the type of | |
33 | .I *ptr | |
34 | beginning at | |
35 | .I ptr | |
36 | to the named output | |
37 | .IR stream . | |
38 | It returns the number of items actually written. | |
39 | .SH "SEE ALSO" | |
40 | read(2), write(2), | |
41 | fopen(3), | |
42 | getc(3), putc(3), | |
43 | gets(3), puts(3), | |
44 | printf(3), scanf(3) | |
45 | .SH DIAGNOSTICS | |
46 | .I Fread | |
47 | and | |
48 | .I fwrite | |
49 | return | |
50 | 0 | |
51 | upon end of file or error. |