Combination of std::ios::openmode to avoid modifications of an existing file?

混江龙づ霸主 提交于 2019-12-23 03:03:58

问题


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.



来源:https://stackoverflow.com/questions/16611977/combination-of-stdiosopenmode-to-avoid-modifications-of-an-existing-file

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