in reply to File opened/closed in Windows.

What are you trying to accomplish? Filemon can dump out tons of messages. Especially if the system runs jobs.

Replies are listed 'Best First'.
Re^2: File opened/closed in Windows.
by Ace128 (Hermit) on Mar 17, 2006 at 00:01 UTC
    I wanna be notified when a file is opened or closed somehow. The goal is to create some kind of callback, which is called when a file in windows is opened or closed. After that I can do fonky stuff, because if a file is closed, its not locked! (although the filemon spits out ALOT, so seems like a file is opened and closed alot...)

      Only one file? If that is the case; I don't think filemon is the way to go as it logs the filesystem so that is many opens and closes you have to contend with.

      This sounds like a security issue? Have you thought about running a service and a routine to do that?

      You could look at Roths Dirmon script and get an idea. This script monitors a directory for adds and deletes.

      May not be what you are looking for but I think filemon will be a moster if I understand what you are after. We have used filemon but we ran it and greped out the stuff we wanted.....

        Thanks, but I get to know when a file is new/deleted/modified with the Win32::AdvNotify or Win32::ReadDirectoryChanges. I wanna know when a file is opened and/or closed. Seems like I have to do this the hard way, and figure it out myself using Filemon and google... ;)