关于file文件操作的头文件 【LINUX】 (转载)

    转自:http://blog.csdn.net/figo77ll/article/details/3156052

 

    Linux下如果要对文件进行读取访问,需要包含至少以下两个头文件:

#inlcude <unistd.h>
#inlcude <fcntl.h>

   

    其中fcntl.h包含了create和open命令,unistd包含了其他的诸如read, write, close等命令。很奇怪为什么不把fcntl的功能直接放到unistd里面呢。。

 
    如果要对STDIN,STDOUT进行“文件操作”,直接包含以下C的标准库就好了:
   
#include <stdio.h>

 

posted on 2014-07-08 17:35  次奥砖家  阅读(2390)  评论(0编辑  收藏  举报

导航