c++ - Combination of std::ios::openmode to truncate if the file exists but prevent new file creation? -


i have asked earlier if there combination of openmode avoid modifications of existing file. know if contrary possible :

  1. if file exists, truncate (std::ios::trunc)
  2. if file not exist, nothing

is there std::ios::openmode available std::ofstream?

to best of knowledge, there no such open mode (it not common use case). guess first check whether file exists and, if does, open trunc open mode.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -