On 1/18/06, Stephan Leemburg <[EMAIL PROTECTED]> wrote:
> I'm using kqueue events to trigger certain programs. The programs run
> when a file is dropped into a certain directory. To avoid race
> conditions, I want to know if the newly created or modified files are
> still open by a process, so I can do what I need to do when no-one
> else is possibly working on the file. Is there a way, other than
> repeating the tricks in lsof, to find out if a file is still open
> from within a c program?

and if somebody opens the file after you determine it's not open? 
you're solving the problem the wrong way.  don't put the file in the
directory until you are done with it.

Reply via email to