stdio(3) Library Functions Manual stdio(3) stdio - - Standard C library (libc, -lc) #include extern FILE *stdin; extern FILE *stdout; extern FILE *stderr; - -. , - . ; . A stream is associated with an external file (which may be a physical device) by opening a file, which may involve creating a new file. Creating an existing file causes its former contents to be discarded. If a file can support positioning requests (such as a disk file, as opposed to a terminal), then a file position indicator associated with the stream is positioned at the start of the file (byte zero), unless the file is opened with append mode. If append mode is used, it is unspecified whether the position indicator will be placed at the start or the end of the file. The position indicator is maintained by subsequent reads, writes, and positioning requests. All input occurs as if the characters were read by successive calls to the fgetc(3) function; all output takes place as if all characters were written by successive calls to the fputc(3) function. . (flushed) ( ). FILE (). , ( ). exit(3), (, , ). , , abort(3), . , : (standard input) ( ), (standard output) ( ) (standard error) ( ). : stdin, stdout stderr. , ; , - . , , ; , . , , fflush(3), . stdio libc, cc(1) . , . ; #undef: BUFSIZ, EOF, FILENAME_MAX, FOPEN_MAX, L_cuserid, L_ctermid, L_tmpnam, NULL, SEEK_END, SEEK_SET, SEEK_CUR, TMP_MAX, clearerr, feof, ferror, fileno, getc, getchar, putc, putchar, stderr, stdin, stdout. feof, ferror, clearerr, fileno, getc, getchar, putc, putchar , . ------------------------------------------------------------------------ clearerr(3) fclose(3) fdopen(3) feof(3) ferror(3) fflush(3) fgetc(3) fgetpos(3) fgets(3) fileno(3) fmemopen(3) open memory as stream fopen(3) fopencookie(3) open a custom stream fprintf(3) fpurge(3) fputc(3) fputs(3) fread(3) - freopen(3) fscanf(3) fseek(3) fsetpos(3) ftell(3) fwrite(3) - getc(3) getchar(3) gets(3) getw(3) mktemp(3) () open_memstream(3) open a dynamic memory buffer stream open_wmemstream(3) open a dynamic memory buffer stream perror(3) printf(3) putc(3) putchar(3) puts(3) putw(3) remove(3) rewind(3) scanf(3) setbuf(3) setbuffer(3) setlinebuf(3) setvbuf(3) sprintf(3) sscanf(3) strerror(3) sys_errlist(3) sys_nerr(3) tempnam(3) tmpfile(3) tmpnam(3) ungetc(3) vfprintf(3) vfscanf(3) vprintf(3) vscanf(3) vsprintf(3) vsscanf(3) C11, POSIX.1-2008. C89, POSIX.1-2001. close(2), open(2), read(2), write(2), stdout(3), unlocked_stdio(3) () Alexander Golubev , Azamat Hackimov , Hotellook, Nikita , Spiros Georgaras , Vladislav , Yuri Kozlov , Kirill Rekhov ; GNU (GNU General Public License - GPL, 3 ) , - . - , , () () () <>. Linux man-pages 6.12 24 2024 . stdio(3)