naotang的测试成长空间,记录工作中的问题,学习中的心得。
个人网站:www.naotang.com
C 中关于文件操作的函数
上一篇 /
下一篇 2007-09-14 14:22:21
/ 个人分类:其他资源
//
fopen()函数
51Testing软件测试网ai9Ly3h*jFILE *fopen(const char *filename, const char *mode)
51Testing软件测试网|g3c!d YvBfopen opens the named file, and returns a stream, or NULL if the attempt fails. Legal values for mode include:
(b+Rwh;B+O0"r" open text file for reading
!oD X8x
Dtd4d0"w" create text file for writing; discard previous contents if any
51Testing软件测试网oNa)a1_`} `M7F"a" append; open or create text file for writing at end of file
51Testing软件测试网;Ua-E
q/_6D7B)l9Q7A-X"r+" open text file for update (i.e., reading and writing)
&WTh^D-~/@ |a+N0"w+" create text file for update, discard previous contents if any
"w.H0nay4w1A0"a+" append; open or create text file for update, writing at end
pq$F.N,^0W051Testing软件测试网)E&]0T(I4Z;qr"xPUpdate mode permits reading and writing the same file; fflush or a file-positioning function must be called between a read and a write or vice versa. If the mode includes b after the initial letter, as in "rb" or "w+b", that indicates a binary file. Filenames are limited to FILENAME_MAX characters. At most FOPEN_MAX files may be open at once.