Subject: Re: "knowing" when a file is available in a directory
To: Eric McWhorter <emcwhorter@xsis.xerox.com>
From: Bill Sommerfeld <sommerfeld@orchard.arlington.ma.us>
List: port-i386
Date: 10/06/1999 11:00:41
> Not being especially familiar with the NetBSD kernel, could someone
> tell me if there is a way to get some sort of notification in a
> userland process from the kernel that a new disk file has been
> created?  I could hack some system call in some kludgy way, but I'd
> probably do something wrong and I'm hoping there's already some sort
> of hook for this sort of thing.

Just to understand what you're doing..

You're looking for files to be created in a particular directory?
and you have some sort of protocol so that partially-created files
won't be mistaken?

About the only existing hook for this is the ktrace interface, but
that's definitely overkill.

How quickly do you need detect the new file?  you could poll once a
second for a change in modification time on the directory.  On a local
filesystem it shouldn't be too painful..

Another possibilty is if you provide the "filesystem" (e.g., via some
sort of hack to the portal filesystem).

					- Bill