fopen.3s

来自「unix v7是最后一个广泛发布的研究型UNIX版本」· 3S 代码 · 共 90 行

3S
90
字号
.TH FOPEN 3S .SH NAMEfopen, freopen, fdopen \- open a stream.SH SYNOPSIS.B #include <stdio.h>.PP.SM.B FILE.B *fopen(filename, type).br.B char *filename, *type;.PP.SM.B FILE.B *freopen(filename, type, stream).br.B char *filename, *type;.br.SM.B FILE.B *stream;.PP.SM.B FILE.B *fdopen(fildes, type).br.B char *type;.SH DESCRIPTION.I Fopenopens the file named by.I filenameand associates a stream with it..I Fopenreturns a pointer to be used to identifythe stream in subsequent operations..PP.I Typeis a character string having one of the following values:.TP 5"r"open for reading.ns.TP 5"w"create for writing.ns.TP 5"a"append: open for writing at endof file, or create for writing.PP.I Freopensubstitutes the named file in placeof the open.IR stream .It returns the original value of.IR stream .The original stream is closed..PP.I Freopenis typically used to attach the preopenedconstant names,.B stdin, stdout, stderr,to specified files..PP.I Fdopenassociates a stream with a file descriptor obtained from.I open, dup, creat,or.IR pipe (2).The.I typeof the stream must agree with the mode of the open file..SH "SEE ALSO"open(2),fclose(3).SH DIAGNOSTICS.I Fopenand .I freopenreturn the pointer.SM.B NULLif.I filenamecannot be accessed..SH BUGS.I Fdopenis not portable to systems other than UNIX.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?