以下示例是关于Whatever中包含O_CREAT 打开用法的示例代码,想了解O_CREAT 打开的具体用法?O_CREAT 打开怎么用?O_CREAT 打开使用的例子?那么可以参考以下相关源代码片段来学习它的具体使用方法。
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);
}
本文地址:https://www.itbaoku.cn/snippets/785383.html