FILES

* filewatcher.jar - compiled for JDK 1.3, self-executing JAR, you can double-click on it to launch the program
* filewatcher.zip - source code including build.xml file for Ant that has targets defined for compiling and generating Javadoc API documentation

USAGE

File
|
+-Open: opens a file in the same window
|
+-New Window: opens a new window
|
+-Exit: kills the program (all windows will go away)

Edit
|
+-Copy: copies selection to the clipboard
|
+-Select All: selects everything in the window

View
|
+-Clear: clears text in the window
|
+-Tail: reads the end of the file and moves the curor there, also gets rid of extra characters in the begining that are too far back (see PREFERENCES)
|
+-Refresh: re-reads the file from the beginning
|
+-Pause: start/stop monitoring file's changes (when in off state, filewatcher keeps watching for changes in the file).  One interesting use of this is to pause it and use View>Tail to catch up to the latest changes.
|
+-Properties: displays preferences dialog (see PREFERENCES)

PREFERENCES

Delay: delay between file change checks in seconds

Font Size: font size in the text window

Max Chars Back: maximum number of characters to be displayed before checking for file changes

HOW IT WORKS

Filewatcher is a program designed for monitoring files that get appended to.  The most frequent application of this is watching log files.  The main benefit of Filewatcher as opposed to tail is that all files can be monitored within a single process.  Another interesting feature of Filewatcher is that it can "open" files that don't exist.  For example if you pop up the file chooser dialog and type in "c:\temp\cmd.log" and that file doesn't exist, Filewatcher will silently accept that, but won't do anything until that file actually appears on the file system, at which point it will start displaying it.  Consequently, a file that Filewatcher is monitoring can be deleted at any time and Filewatcher will display no text.  Filewatcher will keep silently checking it in the background, if and when said file reappears, it will be displayed again.  There are two criteria that tell Filewatcher that a file has been changed: last date modified and file size.

One main problem with Filewatcher is that it will only read from a file starting from the last place it read.  This can be a problem if the file being watched is not appended but rather overwritten.  If it's overwritten with text that's shorter than what's been previously read, no change will be displayed.  If the text is longer than what was previously read, only the extra characters will be displayed.  If a file is overwritten it can be reread in its entirety by selecting View>Refresh menu option.

    Source: geocities.com/inline_four/java/lib

               ( geocities.com/inline_four/java)                   ( geocities.com/inline_four)