Re: Sample polling program code?



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

.



Relevant Pages

  • tail command : differences between solaris and linux
    ... I've noticed if I try to install the JMF, downloaded from Sun Micro, the script fails: ... ...and if I restore the file, then change the tail command that is trying to dump out the code section: ...
    (Fedora)
  • Re: Louise - Better
    ... becomes hypersensitive about her tail and butt - very brief and ... transient, and probably to be expected at this point. ...
    (rec.equestrian)
  • Re: linked lists
    ... > given how you are constructing it. ... You return the tail, perhaps ...
    (comp.lang.c)
  • Re: A bit of a road trip.
    ... >> It all started when I decided to go on the snow run. ... > <snip> the good stuff... ... Creativity is born from necessity. ... A Lizard can always grow a new tail, A Biker must always watch his tail. ...
    (rec.motorcycles.harley)
  • Re: OT VP shoots sleazy lawyer
    ... Although I prefer to ride sweep (bringing up ... the tail end of a group of riders), I now prefer to lead the way ...
    (rec.motorcycles.harley)