📜  O_CREAT open - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:06.377000             🧑  作者: Mango

代码示例1
int fd = open(path, O_WRONLY | O_CREAT | O_EXCL, 0644);
if ((fd == -1) && (EEXIST == errno))
{
    /* open the existing file with write flag */
    fd = open(path, O_WRONLY);
}