I am writing a daemon that utilizes inotify to monitor file access and it is critical that I don't miss anything on a recursive search. I found this interesting idea and have begun to implement it.
ftw() and ftw64() do not use a breadth-first algorithm, its more "pre-order". nftw() gives me the option of depth-first, but I'm worried about races in upper leaves.
I'm hoping that I'm missing something, perhaps a GNU extension? Or am I just looking at implementing my own with type safe call backs (something I'd really rather not do) ?
Or, is my understanding of the advantages of breadth-first over depth-first erroneous for this type of application?