On Wed, Dec 10, 2008 at 09:12:35PM +0200, Graham Leggett <[EMAIL PROTECTED]> wrote: > Given a stat watcher, how do I detect whether a file has been deleted > and recreated?
When a path is not there, st_nlink becomes zero, when it gets recreated nlink goes to one again. > 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. Yes. > I would have thought that st_ino would change if the file is recreated, > but it doesn't seem to do so. Then your filesystem reuses the same inode number. > Can anyone confirm what the correct way is to handle this? What do you perceive as incorrect? If you are concerned about races, when you are not looking fast enough, then there is no way to avoid those. -- The choice of a Deliantra, the free code+content MORPG -----==- _GNU_ http://www.deliantra.net ----==-- _ generation ---==---(_)__ __ ____ __ Marc Lehmann --==---/ / _ \/ // /\ \/ / [EMAIL PROTECTED] -=====/_/_//_/\_,_/ /_/\_\ _______________________________________________ libev mailing list libev@lists.schmorp.de http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev