W
William Xu
I try to write a Logger class, using std:fstream. One of the
requirements is that the log file size could be limited to some bytes.
So I'm thinking that I should check its size before writing new
contents. I wrote something like:
,----
| std:fstream log("foo.txt");
|
| log << "hello" << std::endl;
|
| // How much characters in `log' now?
`----
How can I get the size info from `log' ? I failed to find a sufficient
api from the c++ std.
requirements is that the log file size could be limited to some bytes.
So I'm thinking that I should check its size before writing new
contents. I wrote something like:
,----
| std:fstream log("foo.txt");
|
| log << "hello" << std::endl;
|
| // How much characters in `log' now?
`----
How can I get the size info from `log' ? I failed to find a sufficient
api from the c++ std.