Dunno if anyone is interested, but I have made a very
simeple change that allows for files that have shrunk, or
We have a situation where we have a log file that we
are 'tail'ing and everytime the application restarts, the
log file is cleared and restarted...
This has the efect in TailForWin32 that we get an error
popup: "Could not allocate memory for file!"
This is because of a negative dwBufferSize value when
the file has shrunk..
I added the following lines of code in the ReaderThread
method in the TailView.cpp file from the "4.2.1" stable
I don't have a diff to create adiff file, but it is a simple
change so here goes.. It's around line 944..
// New code STARTS here
// Check if the file has shrunk...
if (dwNewFileSize < dwOldFileSize)
// Clear the Text
// setup as a bFirst..
bFirst = TRUE;
// Old size is now 0
dwOldFileSize = 0;
// New code ENDS here
if (bFirst && bIgnoreHotStartup)
dwBufferSize = dwNewFileSize + 1;