in reply to Monitoring filesystem for file/folder changes

Have you looked at Win32::ChangeNotify?

--
jpg
  • Comment on Re: Monitoring filesystem for file/folder changes

Replies are listed 'Best First'.
Re^2: Monitoring filesystem for file/folder changes
by Ace128 (Hermit) on Jun 04, 2005 at 23:12 UTC
    First, sorry, forgot to login for the reply above. And yea, found that, and I suppose Im gonna use that for the Windows version of my app. One question about this though... Is it heavy use to monitor.. say D:/ which contains 2000+ files and like 500 folders? Guess how that module actually "monitors". If it goes recursivly, I can almost do that myself, but then Im back to square 1.
      I've used it, and it's certainly not 'heavy'.
      I guess (haven't looked at the code) that it uses some Win32 APIs, so I doubt it does anything as crude as building a recursive tree. I don't know if it's built the same way, but check out Sysinternal's Filemon utility for a description of a smart way to build something like this. Win32::ChangeNotify has done the heavy interface work for you already, why not use it?
      --
      jpg
        Yeah, think Im gonna use this for Windows. Else I was hoping for something multi-OS solution, but I guess that doesnt really exist, so it has to be seperate things "imported" depending on OS.

        Speaking of this, got some neat trick to require/use perl modules only if they exist or so...? Like:

        use if exists mainmodule::submodule;
Re^2: Monitoring filesystem for file/folder changes
by Ace128 (Hermit) on Jun 05, 2005 at 23:15 UTC
    Ok, how do I get the reason and file when this is triggered??? This DirMon.pl script I get links to in google groups aint helping since it seems this code adds all info into some hashes (recursivly!) and use this to check later when triggered, for the selected dirs to monitor. So, no use of that at all. I dont get it. Why not return that info somehow in the module?
      Ok, found, installed and gonna test Win32::AdvNotify instead! Seems to support returning WHY something happend!