O_EXCL的写出来的字是什么 [英] What is the written-out word for O_EXCL

查看:86
本文介绍了O_EXCL的写出来的字是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我发现找不到写出的单词时,我正在为 open(3)中列出的不同文件标记编写一个安全的 enum类表示 O_EXCL .

I was writing a safe enum class for the different file flags listed in open(3), when I noticed that I couldn't find the written-out word for O_EXCL.

enum class Flags {
    readOnly, // O_RDONLY
    truncate, // O_TRUNC
    ?         // O_EXCL
};

我想到了两种可能的含义:

Two possible meanings come into my mind:

  • OPEN_EXCLUSIVE
  • OPEN_EXISTS_CLOSE

但是我找不到任何有关预期含义的资源.

But I can't find any resources on the intended meaning.

推荐答案

此处的专有名词是正确的,因为该标志是 O_CREAT 标志的专有标志,如果文件存在,该函数将失败.(如果未设置 O_CREAT 标志,则行为是不确定的.)

Exclusive would be a correct word here, since the flag is exclusive to the O_CREAT flag and makes the function fail if the file exists. (If the O_CREAT flag is not set the behavior is undefined.)

这篇关于O_EXCL的写出来的字是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆