Re: Sample polling program code?



sk8terg1rl wrote:
(snip)

Ah, tail was very useful thanks.

Incidentally, while we're on topic, is there a handy Linux utility
that counts the number of lines in a file? I know vi does when you
first enter the file (something like "a_file" 12345L, 1130670C)

That would be wc, which counts lines, words, and characters.

How do you write a periodic code in Fortran, something like "do this
every 5 seconds"? I thought about an infinite do/read loop like below
but that's horribly wasteful of computer resources.

The unix system call is sleep(int seconds). I don't know
how hard that is to call from Fortran.

-- glen

.