watching for file creation completion [was Re: Synchronous signal delivery..]

Alexander Kellett
2003-03-27T21:29:14Z

hiya all,

On Thu, Feb 13, 2003 at 11:45:18PM +0300, Paul P Komkoff Jr wrote:
> These functions have one nice purpose: we can watch a directory hierarchy
> for changes an efficient way. e.g. AFAIK via dnotify I can only see that
> directory was changed, but cannot actually get all the changes. If I will
> re-read all directory, I can miss some changes (if other process is
> tampering with this dir too).

fully agreed. queued events / batch notifications would also be kind of nice.

the fact that it is not possible to see if a file write has been
completely written out currently (i.e, written to and then closed)
is quite frustrating. anyone got any ideas for this?

currently i'm doing the ugly - readdir on dnotify signal, then
check mtime's to see if > 5 seconds, and just assume the writing
process has finished, then force a readdir in case any events
were missed while dnotify notification was off.

mvg,
Alex