本文介绍了组合std :: ios :: openmode以避免修改现有文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有 std :: ios :: openmode 的可用组合,以避免修改现有文件并只允许创建新文件?

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 ?

推荐答案

没有没有。参见C ++ 03标准§27.4.2.1.4 / 1或C ++ 11标准§27.5.3.1.4 / 1
如果手或其他。由于可以连接以形成 openmode
的指定常量的
意味着打开的文件不应 >存在没有连接,他们可以有
的含义。

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/1if to hand or otherwise http://en.cppreference.com/w/cpp/io/ios_base/openmode. As noneof the specified constants that may be |-conjoined to form an openmodeimplies that the opened file shall not exist no conjunction of them can have that implication.

这篇关于组合std :: ios :: openmode以避免修改现有文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 20:37