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