You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure what the intended behavior is, but fmt::output_file, when opened on an existing file, does not clear its contents. That is, given this code:
auto out = fmt::output_file("data/test.txt");
out.print("Hello World!\n");
and this text in data/test.txt:
This should be overwritten completely!
the file looks like this after running the code:
Hello World!
e overwritten completely!
I believe this behavior is not intuitive and can cause subtle bugs; therefore, the default should be changed to clear all the contents, or at least it should be documented.
fmt version: 7.1.2
OS: Linux
The text was updated successfully, but these errors were encountered:
I'm not sure what the intended behavior is, but
fmt::output_file
, when opened on an existing file, does not clear its contents. That is, given this code:and this text in
data/test.txt
:the file looks like this after running the code:
I believe this behavior is not intuitive and can cause subtle bugs; therefore, the default should be changed to clear all the contents, or at least it should be documented.
The text was updated successfully, but these errors were encountered: