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