title: How can I follow a file like "Tail -f" does in Java without holding the file open (Prevent rename/delete)
body: <p>i'd like to "Tail -f" a lot of logfiles from within a java app.</p>
  
  <p>I've gotten this to work by monitoring the size and last update and repeatedly opening the file and reading the last few bytes whenever the file size or last update time changes--then closing it right away. </p>
  
  <p>This seems problematic because I might have it open when the logger decides to rename the file which will cause some kind of problem. </p>
  
  <p>I'd also like to detect a "Rolled" file with a mechanism more sure than noticing that the file size reduced... seems error prone but unlikely.</p>
  
  <p>Since I don't seem to have access to the file descriptor or other low-level file utilities I may not be able to reproduce tail's behavor--but are there any tricks to reading a file without "Locking" it for rename/delete (Windows 7)</p>
  
  <p>I guess another possibility is to actually spawn a tail -f process and read the process output, but that seems somewhat heavy--I'm scanning like 60 logfiles here, some of which have a lot of output (Most will be idle).</p>