How to pause until file changes are made?

I want to monitor a text file.
So far what I have is the program reads and prints the names in the file to standard out.
When the program reaches the end of the file, it closes.

I want the program to stay active and continue to print names as they are saved to the text file.

I was toying with FindFirstChangeNotification function, but it seems that returns a handle so I'm back to the drawing board.

Any help would be appreciated
GNU coreutils package has program 'tail'. Tails has option "follow":
-f, --follow[={name|descriptor}]
    output appended data as the file grows


The source code is available according to GPLv3 license, so you can take a peek on how tail does it.
Topic archived. No new replies allowed.