c++ - 只要应用程序运行就一直打开错误日志是否可以接受?

标签 c++ file stream filestream

是否可以接受在初始化应用程序时打开错误文件输出流,并且在应用程序停止运行之前不关闭它?文件会不会在一段时间后自动关闭?保持文件打开会以任何方式限制我吗?

最佳答案

Is it acceptable, to open an error file output stream when initializing the application, and not ever close it till your application stops running?

是的。

Can it occur the file will get closed automatically after a while?

没有。

Does keeping the file open limit me in any way?

不(好吧,它会计入您的最大打开文件数,但这不太可能成为问题)。

关于c++ - 只要应用程序运行就一直打开错误日志是否可以接受?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19202375/

相关文章:

计算标签数并检查行长度

java - 为什么flush()会影响PrintWriter上的println()

c++ - 流出字符串的一部分

c++ - 无法使用 booster、C++、graphlab 解析 pm 格式的日期时间

c++ - 如何获取物理和逻辑磁盘列表?

python - 如何创建具有给定增量的数字范围

Scala:结束 Stream.iterate

c++ - 确保使用 async_read 读取数据

c++ - 如何在启用 ANSI 的同时在 gcc 中启用 C++ 样式的注释?

c++打开.txt文件并读取数字以放置在数组中