Commit | Line | Data |
---|---|---|
f0c63b06 C |
1 | .TH FREAD 3S "19 January 1983" |
2 | .UC 4 | |
3 | .SH NAME | |
4 | fread, 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 | |
21 | reads, into a block beginning at | |
22 | .IR ptr , | |
23 | .I nitems | |
24 | of data of the type of | |
25 | .I *ptr | |
26 | from the named input | |
27 | .IR stream . | |
28 | It returns the number of items actually read. | |
29 | .PP | |
30 | If | |
31 | .I stream | |
32 | is | |
33 | .B stdin | |
34 | and the standard output is line buffered, then any partial output line | |
35 | will be flushed before any call to | |
36 | .IR read (2) | |
37 | to satisfy the | |
38 | .IR fread . | |
39 | .PP | |
40 | .I Fwrite | |
41 | appends at most | |
42 | .I nitems | |
43 | of data of the type of | |
44 | .I *ptr | |
45 | beginning at | |
46 | .I ptr | |
47 | to the named output | |
48 | .IR stream . | |
49 | It returns the number of items actually written. | |
50 | .SH "SEE ALSO" | |
51 | read(2), | |
52 | write(2), | |
53 | fopen(3S), | |
54 | getc(3S), | |
55 | putc(3S), | |
56 | gets(3S), | |
57 | puts(3S), | |
58 | printf(3S), | |
59 | scanf(3S) | |
60 | .SH DIAGNOSTICS | |
61 | .I Fread | |
62 | and | |
63 | .I fwrite | |
64 | return | |
65 | 0 | |
66 | upon end of file or error. |