infrequent that I happen to see that dialog! Reasons might include
problems with the character encoding, full disks, or recently,
You should simply flush the log file periodically (keeping it open of >course).
I wrote a small Python script to append a line to the end
of a log file. This script is invoked from a VBA subroutine
to append a line to that log file.
In the same VBA subroutine, I then read the last line from
the same log file and compare it with the line to be written.
If they do not agree, the VBA subroutine opens a new message
box informing the user.
This might sound overly defensive, but in fact it is not
infrequent that I happen to see that dialog! Reasons might include
problems with the character encoding, full disks, or recently,
a possible spurious error message for reasons (yet) unknown
(maybe due to an overload of the system, which led to timeouts).
"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
You should simply flush the log file periodically (keeping it open of
course).
This log file gets infrequent writes. Not more than 1000 per day.
So to append a line, I always open the file for appending, write
the line, and close it immediately.
This log file gets infrequent writes. Not more than 1000 per day.
So to append a line, I always open the file for appending, write
the line, and close it immediately.
Keep it open. Flush after each write since it is infrequent.
But several different processes could append to that log file.
ram@zedat.fu-berlin.de (Stefan Ram) writes:
This log file gets infrequent writes. Not more than 1000 per day.
So to append a line, I always open the file for appending, write
the line, and close it immediately.
But several different processes could append to that log file.
"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:That upon system crash you won't lose all file, since it is never closed.
Keep it open. Flush after each write since it is infrequent.What's the problem this is supposed to be the solution to?
"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:That upon system crash you won't lose all file, since it is never closed.
Keep it open. Flush after each write since it is infrequent.What's the problem this is supposed to be the solution to?
That's why I always keep it open as short as possible;
I immediately close it after every append. I think, ">>"
does this too. It might be open for append access few
seconds per day.
"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
Keep it open. Flush after each write since it is infrequent.
What's the problem this is supposed to be the solution to?
ram@zedat.fu-berlin.de (Stefan Ram) writes:
But several different processes could append to that log file.
Including batch files using ">>".
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (0 / 16) |
Uptime: | 113:44:22 |
Calls: | 6,701 |
Calls today: | 1 |
Files: | 12,235 |
Messages: | 5,348,928 |