Friday, February 26, 2010

Possible problem with sudden shortening of very large files by an external process

I often misuse vim to view log files while debugging batch jobs. It is
very handy for moving around in the file, viewing the colorized content
and searching for relevant text. These log files can be from several
thousand to millions of lines. Vim does a remarkably good job of
handling these files. However, sometimes it has a problem when the
batch job is re-run while I am viewing the file in vim, and the log file
is replaced by a much shorter one.

When vim tries to reload the file, sometimes I get a very long series of
red warning messages - I can't repeat the event just now, so can't
provide the content of the warning, but I think it has to do with
missing lines.

This succession of warnings can be inconvenient when there are several
million to report, or even a few thousand! And very occasionally vim
hangs (apparently), or just gives up the ghost and dies. I think
problems are more likely when the 'present location' is far down the
file.

Considering the abuse I am giving vim this is within the range of
acceptable behavior, but I thought it was worth mentioning as an issue
anyway. From the behavior, I speculate that vim has found the present
line to be after the end of file, is trying to move the line pointer
upwards one line at a time, and is finding no data there each time.
--
"He that breaks a thing to find out what it is has left the path of
wisdom."-- J.R.R. Tolkien
- But where does that leave particle physics?

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment