December
5th August 2008, 17:41
Hi All,
I'm using QFile and QTextStream to log data from a server application.
My problem is I want to be able to rotate out the log files using an external program.
When the log file gets removed, how can I detect that I need to re-open it from the app?
Calling fileExists() with every write to the log seems horribly time consuming.
file->error() doesn't return an error in the above case, neither does textstream->status(). The log file is not there, but no new one is created, and the data supposedly being written is just lost!
Any ideas?
Thanks.
I'm using QFile and QTextStream to log data from a server application.
My problem is I want to be able to rotate out the log files using an external program.
When the log file gets removed, how can I detect that I need to re-open it from the app?
Calling fileExists() with every write to the log seems horribly time consuming.
file->error() doesn't return an error in the above case, neither does textstream->status(). The log file is not there, but no new one is created, and the data supposedly being written is just lost!
Any ideas?
Thanks.