Suppose a long-running process writes to a log file. Suppose that log file is kept open indefinitely. Suppose that a careless system administrator deletes that log file.
When a file is closed the modification time is changed. So check periodically on the mtime using stat() will work.