Combination of std::ios::openmode to avoid modific

2019-05-31 19:48发布

Is there an available combination of std::ios::openmode to avoid modifications of an existing file and allow only the creation of a new one ?

1条回答
唯我独甜
2楼-- · 2019-05-31 20:38

No there isn't. See the C++03 Standard § 27.4.2.1.4/1, or the C++11 Standard § 27.5.3.1.4/1 if to hand or otherwise http://en.cppreference.com/w/cpp/io/ios_base/openmode. As none of the specified constants that may be |-conjoined to form an openmode implies that the opened file shall not exist no conjunction of them can have that implication.

查看更多
登录 后发表回答