Re: Sample polling program code?
- From: glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxx>
- Date: Fri, 30 Mar 2007 12:27:46 -0800
dpb wrote:
(snip)
Depending on the OS, it may be possible to open a file for shared read
access and continue to attempt to read it for "magic" data. If it
were possible, again w/ some facility like that above to write a new
file or other output when the condition was recognized internally so
that the appearance of this new file was the key.
This is commonly done in unix with the tail -f command.
I have had versions of tail -f that would run under windows.
Normally tail prints the last 10 lines of a file and stops.
tail -f prints the last 10 lines, then sleeps one second,
and tries to read more, with a sleep/read loop. It will then
follow the file as it grows. You can pipe the output of
tail -f into other programs, which can then process the output
without the need to detect end of file. I would probably use
awk to check for the appropriate condition and execute the
appropriate kill command.
-- glen
.
- References:
- Re: Sample polling program code?
- From: dpb
- Re: Sample polling program code?
- Prev by Date: Re: undefined variable problem
- Next by Date: array operations on non-conforming arrays -- do compilers catch them?
- Previous by thread: Re: Sample polling program code?
- Next by thread: Re: Sample polling program code?
- Index(es):
Relevant Pages
|