NAME
fread, fwrite - binary stream input/output
SYNOPSIS
#include <stdio.h> size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream); size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);
DESCRIPTION
The function fread() reads nmemb items of data, each size bytes long, from the stream pointed to by stream, storing them at the location given by ptr. The function fwrite() writes nmemb items of data, each size bytes long, to the stream pointed to by stream, obtaining them from the location given by ptr. For nonlocking counterparts, see unlocked_stdio(3).
RETURN VALUE
On success, fread() and fwrite() return the number of items read or written. This number equals the number of bytes transferred only when size is 1. If an error occurs, or the end of the file is reached, the return value is a short item count (or zero). fread() does not distinguish between end-of-file and error, and callers must use feof(3) and ferror(3) to determine which occurred.
ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7). Interface Attribute Value fread(), fwrite() Thread safety MT-Safe
CONFORMING TO
POSIX.1-2001, POSIX.1-2008, C89.
SEE ALSO
read(2), write(2), feof(3), ferror(3), unlocked_stdio(3)
COLOPHON
This page is part of release 4.09 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.
More Linux Commands
manpages/ldap_next_attribute.3.html
ldap_next_attribute(3) - step through LDAP entry attributes
The ldap_first_attribute() and ldap_next_attribute() routines are used to step through the attributes in an LDAP entry. ldap_first_attribute() takes an entry as
manpages/tty.1.html
tty(1) - print the file name of the terminal connected to st
Print the file name of the terminal connected to standard input. -s, --silent, --quiet print nothing, only return an exit status --help display this help and ex
manpages/Tcl_CreateChannel.3.html
Tcl_CreateChannel(3) - procedures for creating and manipulat
Tcl uses a two-layered channel architecture. It provides a generic upper layer to enable C and Tcl programs to perform input and output using the same APIs for
manpages/setstate.3.html
setstate(3) - random number generator - Linux manual page...
The random() function uses a nonlinear additive feedback random number generator employing a default table of size 31 long integers to return successive pseudo-
manpages/Tk_FreeBitmap.3.html
Tk_FreeBitmap(3) - maintain database of single-plane pixmaps
These procedures manage a collection of bitmaps (one-plane pixmaps) being used by an application. The procedures allow bitmaps to be re-used efficiently, thereb
manpages/ScreenCount.3.html
ScreenCount(3) - Display macros and functions (Man Page)....
The AllPlanes macro returns a value with all bits set to 1 suitable for use in a plane argument to a procedure. The BlackPixel macro returns the black pixel val
manpages/Tcl_SetVar.3.html
Tcl_SetVar(3) - manipulate Tcl variables - Linux man page...
These procedures are used to create, modify, read, and delete Tcl variables from C code. Tcl_SetVar2Ex, Tcl_SetVar, Tcl_SetVar2, and Tcl_ObjSetVar2 will create
manpages/XtGetApplicationResources.3.html
XtGetApplicationResources(3) - obtain application resources
The XtGetApplicationResources function first uses the passed widget, which is usually an application shell, to construct a resource name and class list, Then, i
manpages/Net::Server::Proto::TCP.3pm.html
Net::Server::Proto::TCP(3pm) - (unknown subject) (Man Page)
Protocol module for Net::Server. This module implements the SOCK_STREAM socket type under INET (also known as TCP ). See Net::Server::Proto. PARAMETERS There ar
manpages/pam_getenvlist.3.html
pam_getenvlist(3) - getting the PAM environment (Man Page)
The pam_getenvlist function returns a complete copy of the PAM environment as associated with the handle pamh. The PAM environment variables represent the conte
manpages/XContextDependentDrawing.3.html
XContextDependentDrawing(3) - obtain fontset information....
The XFontsOfFontSet function returns a list of one or more XFontStructs and font names for the fonts used by the Xmb and Xwc layers for the given font set. A li
manpages/pair_content_sp.3ncurses.html
pair_content_sp(3ncurses) - curses screen-pointer extension
This implementation can be configured to provide a set of functions which improve the ability to manage multiple screens. This feature can be added to any of th
