fread, fwrite - binary stream input/output
#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);
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).
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.
For an explanation of the terms used in this section, see attributes(7). ┌──────────────────┬───────────────┬─────────┐ │Interface │ Attribute │ Value │ ├──────────────────┼───────────────┼─────────┤ │fread(), fwrite() │ Thread safety │ MT-Safe │ └──────────────────┴───────────────┴─────────┘
POSIX.1-2001, POSIX.1-2008, C89.
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
innetgr(3) - handle network group entries - Linux man page
The netgroup is a SunOS invention. A netgroup database is a list of string triples (hostname, username, domainname) or other netgroup names. Any of the elements
open(3pm) - perl pragma to set default PerlIO layers for inp
Full-fledged support for I/O layers is now implemented provided Perl is configured to use PerlIO as its IO system (which is now the default). The open pragma se
imaxabs(3) - compute the absolute value of an integer.......
The abs() function computes the absolute value of the integer argument j. The labs(), llabs() and imaxabs() functions compute the absolute value of the argument
XDisplayName(3) - default error handlers - Linux man page...
Xlib generally calls the programs supplied error handler whenever an error is received. It is not called on BadName errors from OpenFont, LookupColor, or AllocN
fifo(4) - first-in first-out special file, named pipe.......
A FIFO special file (a named pipe) is similar to a pipe, except that it is accessed as part of the file system. It can be opened by multiple processes for readi
Tk_MapWindow(3) - map or unmap a window - Linux manual page
These procedures may be used to map and unmap windows managed by Tk. Tk_MapWindow maps the window given by tkwin, and also creates an X window corresponding to
mvadd_wchnstr(3ncurses) - add an array of complex characters
mvadd_wchnstr.3ncurses - These functions copy the (null-terminated) array of complex characters wchstr into the window image structure starting at the current c
acl_delete_def_file(3) - delete a default ACL by filename...
The acl_delete_def_file() function deletes a default ACL from the directory whose pathname is pointed to by the argument path_p. The effective user ID of the pr
cimag(3) - get imaginary part of a complex number (ManPage)
The cimag() function returns the imaginary part of the complex number z. One has: z = creal(z) + I * cimag(z) VERSIONS These functions first appeared in glibc i
gnutls_alert_get_strname(3) - API function - Linux man page
This function will return a string of the name of the alert. RETURNS string corresponding to gnutls_alert_description_t value. SINCE 3.0.0 REPORTING BUGS Report
glMinmax(3gl) - define minmax table - Linux manual page.....
When GL_MINMAX is enabled, the RGBA components of incoming pixels are compared to the minimum and maximum values for each component, which are stored in the 2-e
QLength(3) - Display macros and functions - Linux 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