Win32::ChangeNotify + $module = detect download ?

Discussion in 'Perl Misc' started by perl coder, Feb 16, 2004.

  1. perl coder

    perl coder Guest

    I'm using the Win32::ChangeNotify to monitor a folder, in order to find
    which files are being modified. I setup a handler with the LAST_WRITE
    flag, and it works great, and I can find the exact filename that changed
    by checking the timestamps of all the files in that folder.

    One thing bugs me though: I can't detect whether or not a file is
    changing because it's been closed or if it's still open and actively
    being written to (frex, somebody downloading a file with a web browser
    or something). So I'm wondering if there's a relatively easy way to
    find this out. In Unix you can at least check with 'lsof' and
    'netstat -nap' and get a good idea of what's going on, but I'm new to
    the win32 world, and I'm still not sure of what's possible and what
    isn't. Perhaps is there a module that will help with this? If not, I
    noticed that Perl at least gives a way to make straight win32 system
    calls (with Win32::API), so perhaps there's a system call I can use
    then?

    I'd rather avoid having to check a file at regular intervals to see if
    it's changing. It might work, but doesn't sound like a very robust
    solution. :)


    --
    No crazy stuff in my email. ;-)
     
    perl coder, Feb 16, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daniel Berger

    [ANN] win32-changenotify

    Daniel Berger, May 8, 2004, in forum: Ruby
    Replies:
    0
    Views:
    96
    Daniel Berger
    May 8, 2004
  2. Daniel Berger

    [ANN] win32-changenotify 0.3.0

    Daniel Berger, Jan 25, 2005, in forum: Ruby
    Replies:
    3
    Views:
    103
    Daniel Berger
    Feb 4, 2005
  3. Replies:
    7
    Views:
    107
    Daniel Berger
    Dec 15, 2006
  4. Martin DeMello

    win32::changenotify and multiple events

    Martin DeMello, Feb 28, 2007, in forum: Ruby
    Replies:
    0
    Views:
    104
    Martin DeMello
    Feb 28, 2007
  5. Thomas Kratz

    Leak in Win32::ChangeNotify?

    Thomas Kratz, Dec 28, 2004, in forum: Perl Misc
    Replies:
    4
    Views:
    179
    Matt Garrish
    Dec 29, 2004
Loading...

Share This Page