in reply to Monitoring directory for new files

The only *true* way to avoid race conditions is to use the Win32 API ReadDirectoryChangesW with OVERLAPPED, and do that from C/C++.

Probably not what you want to hear, sorry.

Replies are listed 'Best First'.
Re^2: Monitoring directory for new files
by tokpela (Chaplain) on Jan 21, 2010 at 11:22 UTC

    Actually, there is a module on this site by D. Faure that encapsulates this API - Win32::ReadDirectoryChangesW.

    I found this a few weeks ago and have been using it in a test program and it works well enough for my purposes. I am in the process of moving (countries) but intend to ask D Faure if I can put this on CPAN when I get settled.