>>>>> "JM" == John Macdonald <[EMAIL PROTECTED]> writes:

  JM> On Tue, Feb 21, 2006 at 03:25:08PM -0500, Uri Guttman wrote:
  >> another issue is should you keep a handle open between tail polls or
  >> open it fresh each time? since my code checks the inode number, opening
  >> each time makes more sense.

  JM> Even if you didn't do that to force the inode change, you
  JM> can still tell whether the file has been cycled (even it the
  JM> new  one is back to the same size) by seeking backwards a bit
  JM> and re-reading the last text you pulled in and comparing to
  JM> make sure it is still the same.  (This does assume that log
  JM> file entries have a timestamp or some other component that
  JM> will make an adequately long text segment certain to never be
  JM> exactly duplicated in a subsequent log entry.)

any assumptions mean that it is still 'possible' to not detect changes
in a log file. i wasn't saying it is a real world problem but just that
it isn't bulletproof. it is like a race condition that can rarely
happen.

  JM> Of course, detecting that a log switch of some sort has occurred
  JM> doesn't ensure that you will be able to tell if more than one
  JM> has occurred "very quickly" (from your frame of reference -
  JM> that might mean that your tailing program got paused for a
  JM> long time instead).

well, most tailing doesn't care about how much has changed. tailing just
wants to find and return the appended text. whether it returns large
chunks or many lines isn't a function of the log file but of the tailing
code.

uri

-- 
Uri Guttman  ------  [EMAIL PROTECTED]  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org
 
_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to