EchoAngel has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, I been doing work and I notice time to time that a lump of storage space gets suck up such that I have no space to edit or change files. Recently, I noticed some of my libraries are totally missing/deleted ... Is there anyway I can program like a watchdog program to watch changes in filespaces and by whom.

Replies are listed 'Best First'.
Re: Idea to program watchdog
by gellyfish (Monsignor) on Oct 18, 2004 at 16:12 UTC

    THough not Perl, you might find Tripwire useful for this kind of monitoring.

    /J\

Re: Idea to program watchdog
by ikegami (Patriarch) on Oct 18, 2004 at 16:17 UTC

    In Windows, programs can be notified when a directory changes. File being added, removed and changed are included, and there's a flag to monitor subdirectories. Win32::ChangeNotify implements the functionality. Microsoft's relevant documentation can be found here, in the MSDN library.

    Update: Bad news. Win32::ChangeNotify doesn't call ReadDirectoryChangesW to get the actual changes, and even if it did, which process changed the file is not among the information returned.