Results 1 to 3 of 3

Thread: [RESOLVED] [2.0] Possible? Determine if a windows-related event triggered -- then do something

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2006
    Posts
    56

    Resolved [RESOLVED] [2.0] Possible? Determine if a windows-related event triggered -- then do something

    Here's the situation:

    I have a log file that I want to monitor. This log file will get updated based on certain events that happen within the program that writes the file (this program isn't written by me).

    What I want to do is, if that log file gets updated (a new line is added), I want my program to know this happened.

    I'm fairly certain I could rig a timer to check it every xx seconds. Check the filesize on the log, if it differs than the last time I opened it, then it's been modified. I don't want to do this because I assume it'll be pretty CPU intensive if I have to keep opening a file to check the last line every 1-2 seconds. This log file has the potential to become pretty big (upwards of 500-600kb, maybe even push 1mb).

    Is there a way I can write something that magically knows if the file has changed without it being on a timer?
    Last edited by ThisIsMyUserName; Nov 8th, 2006 at 05:10 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width