Detect when a file has been recreated using a stat watcher

Marc Lehmann schmorp at schmorp.de
Fri Dec 12 19:51:51 CET 2008


On Thu, Dec 11, 2008 at 01:01:00AM +0200, Graham Leggett <minfrin at sharp.fm> wrote:
> I have an fd open to the file, which will never increase in size because  
> the file has been deleted, but my app doesn't yet know that.
>
> Is there a way to detect this?

An ev_stat watcher should reliably detect that case, as logfile rotation
is not very often done, so the ctime should reliably change.

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      pcg at goof.com
      -=====/_/_//_/\_,_/ /_/\_\



More information about the libev mailing list