您的位置:首页 > 其它

S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP 分别是什么意思?

2016-09-01 19:15 344 查看

open第三个参数

一般用法:

if((to_fd = open(to, O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR)) == -1)
{
//db_error("Open %s Error:%s\n", to, strerror(errno));
//close(from_fd);
//return -1;
}


S_IRUSR
Permits the file's owner to read it.
允许文件的所有者阅读它。


S_IWUSR
Permits the file's owner to write to it.
允许文件所有者写它。


S_IRGRP
Permits the file's group to read it.
允许文件组读取它


S_IWGRP
Permits the file's group to write to it.
允许文件组编写它


|是位或运算符。
man creat
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: