What is the written-out word for O_EXCL

霸气de小男生 提交于 2021-01-05 09:20:06

问题


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.


回答1:


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.)



来源:https://stackoverflow.com/questions/48388212/what-is-the-written-out-word-for-o-excl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!