File:  [CSRG BSD Unix] / 43BSDReno / lib / libc / stdio / fread.3
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:55 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43reno
BSD 4.3reno

.\" Copyright (c) 1980 Regents of the University of California.
.\" All rights reserved.  The Berkeley software License Agreement
.\" specifies the terms and conditions for redistribution.
.\"
.\"	@(#)fread.3	6.2 (Berkeley) 4/1/89
.\"
.TH FREAD 3  "April 1, 1989"
.UC 4
.SH NAME
fread, fwrite \- buffered binary input/output
.SH SYNOPSIS
.B #include <stdio.h>
.PP
.B fread(ptr, sizeof(*ptr), nitems, stream)
.br
.SM
.B FILE
.B *stream;
.PP
.B fwrite(ptr, sizeof(*ptr), nitems, stream)
.br
.SM
.B FILE
.B *stream;
.SH DESCRIPTION
.I Fread
reads, into a block beginning at
.IR ptr ,
.I nitems
of data of the type of
.I *ptr
from the named input
.IR stream .
It returns the number of items actually read.
.PP
If
.I stream
is
.B stdin
and the standard output is line buffered, then any partial output line
will be flushed before any call to
.IR read (2)
to satisfy the
.IR fread .
.PP
.I Fwrite
appends at most
.I nitems
of data of the type of
.I *ptr
beginning at
.I ptr
to the named output
.IR stream .
It returns the number of items actually written.
.SH "SEE ALSO"
read(2),
write(2),
fopen(3),
getc(3),
putc(3),
gets(3),
puts(3),
printf(3),
scanf(3)
.SH DIAGNOSTICS
.I Fread
and
.I fwrite
return
0
upon end of file or error.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.