Chinaunix首页 | 论坛 | 博客
  • 博客访问: 588691
  • 博文数量: 68
  • 博客积分: 2621
  • 博客等级: 少校
  • 技术积分: 1498
  • 用 户 组: 普通用户
  • 注册时间: 2010-10-23 21:04
文章分类

全部博文(68)

文章存档

2013年(8)

2012年(52)

2010年(8)

分类: LINUX

2012-03-01 15:49:18

原文:
Macro: int O_ACCMODE This macro stands for a mask that can be bitwise-ANDed with the file status flag value to produce a value representing the file access mode.
The mode will be O_RDONLY, O_WRONLY, or O_RDWR. (In the GNU system it could also be zero, and it never includes the O_EXEC bit.)

翻译:

          这个宏作为一个掩码以与文件状态标识值做AND位运算,产生一个表示文件访问模式的值。

           这模式将是O_RDONLY, O_WRONLY, 或 O_RDWR(在GNU系统中,也可能是零,并且从不包括 O_EXEC 位)

 

O_ACCMODE<0003>:读写文件操作时,用于取出flag的低2位
O_RDONLY<00>:只读打开
O_WRONLY<01>:只写打开
O_RDWR<02>:读写打开


转载自:http://blog.csdn.net/grasspower/article/details/2807672

阅读(3602) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~