摘要: 文件 描述符每打开一个文件或者创建一个文件,就返回一个文件描述符。描述符0 对应 标准输入描述符1 对应 标准输出描述符2 对应 标准出错文件描述符的范围是0~OPEN_MAXOPEN 函数#include<fcnt1.h>int open(const char *pathname, int oflag, mode_t mode)成功返回描述符,错误返回-1open返回的文件描述符一定是最小未用的描述符数值。(例子:关闭标准输出,在打开一个文件,则文件一定会在标准输出打开)creat函数#include《fcnt1.h》int creat(const char *pathname, 阅读全文
posted @ 2013-05-06 15:39 楼上人 阅读(178) 评论(0) 推荐(0) 编辑