in reply to starting a script when a file appears in a directory

I would suggest that you write a daemon that uses the FAM (file access monitor) Module CPAN) and when it sees a change it calls the script.

I do have to preface this with the fact that I did try to use the FAM module early on in my learning of perl and was unsuccessful in getting it to work, but I believe that that was probably a symptom of my newbie-ness and not the ability of the module to do the job!
  • Comment on Re: starting a script when a file appears in a directory

Replies are listed 'Best First'.
Re^2: starting a script when a file appears in a directory
by blazar (Canon) on Apr 20, 2005 at 06:52 UTC
    IIRC FAM has to do with SGI/Irix and while it's obviously sensible to at least mention it in this context, I suppose that at best it is portable to other *NICES (but I would be glad to be disproved!) OTOH the following answer, mentioning a Win32 specific module seems much more on topic.

      SGI::FAM definitely does work on Linux (see for instance Re: pause/wait command? ) and as FAM itself is open source it is possible that it has been ported to other OS too

      /J\

      Agreed. I glossed over the fact that it was on win32 when I replied.

      And yes, it definitely does work! I decided to play around with it last night after posting and got it to do exactly what I expected it to. I must say though that the errors that it throws get a little confusing because it has a lot of xs code in it.
        I must say though that the errors that it throws get a little confusing because it has a lot of xs code in it.
        I must say that I don't know much about the subject matter being actually discussed here. However what I would tend to disagree is the claim above, for out of my (possibly limited) experience I don't see any explicit relation between "having a lot of XS code" and "throwing confusing erros".