Detect when a file has been recreated using a stat watcher

Graham Leggett minfrin at
Wed Dec 10 20:12:35 CET 2008

Hi all,

Given a stat watcher, how do I detect whether a file has been deleted 
and recreated?

I can detect when a file has been deleted by looking at stat.st_nlink, 
but if the file is recreated st_nlink goes back to 1. I would have 
thought that st_ino would change if the file is recreated, but it 
doesn't seem to do so.

Can anyone confirm what the correct way is to handle this?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3287 bytes
Desc: S/MIME Cryptographic Signature
URL: <>

More information about the libev mailing list