Thread: Monitoring a Folder

  1. #1
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,138

    Monitoring a Folder

    I know there's a way to monitor a specific folder. I just forget the function name. Any help?

  2. #2
    Registered User
    Join Date
    Feb 2002
    Posts
    329
    I don't know if this is what you're looking for?

    From MSWDN
    Monitor Sampling Functions
    The monitor sampling functions are high-level functions called by the gateway. These functions internally record simple snapshot statistics and call the Folder Snapshot Functions and the Jump Window Functions to calculate the additional statistics. The monitor maintains a separate thread function, SharedMemoryUpdate, to periodically update the memory-mapped file with the calculated statistics.

    The sample gateway uses monitor sample functions to make calls to MONITOR.LIB, which in turn uses the folder snapshot functions and the jump window functions in STATS.LIB. At regular intervals the SharedMemoryUpdate function copies the calculated statistics to the memory-mapped file.

    The monitor sampling functions are listed in the following table.

    Function Action When called
    HrMonInit Initializes the data collection for all statistics of a folder. As gateway starts.
    HrMonCollectNDRStats Builds statistics on the number of nondelivery reports produced in a folder. For each nondelivery report sent or received.
    HrMonCollectMessage
    XferStats Builds statistics on the number of messages traveling in each direction through the gateway. For each message transferred through the gateway.
    HrMonCollect
    AssociationStats Updates the statistic on the current number of gateway associations. Each time the number of associations changes.
    HrMonLockCounters Locks the counters against access by other threads or processes. Before accessing a user-defined counter.
    HrMonUnlock
    Counters Unlocks the counters to allow access by other threads or processes. After accessing a user-defined counter.
    HrMonUninit Closes down the data collection for all statistics. As gateway stops.

  3. #3
    Registered User
    Join Date
    Feb 2003
    Posts
    76
    Incorrect. This is actually what golfinguy4 means:

    An application can monitor the contents of a directory and its subdirectories by using the FindFirstChangeNotification, FindNextChangeNotification, and FindCloseChangeNotification
    functions. Waiting for a change notification [using the WaitForSingleObject function] is similar to having a read operation pending against a directory and, if necessary, its subdirectories. When something changes within the directory being watched, the read operation is completed. For example, an application can use these functions to update a directory listing whenever a filename within the monitored directory changes.

    An application can specify a set of conditions that trigger a change notification by using the FindFirstChangeNotification function. The conditions include changes to filenames, directory names, attributes, file size, time of last write, and security. This function also returns a handle that can be waited on by using the wait functions. If the wait condition is satisfied, FindNextChangeNotification can be used to provide a notification handle to wait on subsequent changes.

    The FindCloseChangeNotification function closes the notification handle.

  4. #4
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,138
    Thanx. That's exactly it poccil.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reading .dat files from a folder in current directory...
    By porsche911nfs in forum C++ Programming
    Replies: 7
    Last Post: 04-04-2009, 09:52 PM
  2. Not able to access directory of home folder
    By Bargi in forum Linux Programming
    Replies: 1
    Last Post: 02-06-2008, 02:45 AM
  3. read only folder on Windows
    By George2 in forum Windows Programming
    Replies: 2
    Last Post: 11-05-2007, 09:18 AM
  4. Monitoring a folder
    By Calthun in forum Windows Programming
    Replies: 1
    Last Post: 05-01-2005, 09:40 PM
  5. Hiding a folder
    By nextstep in forum Windows Programming
    Replies: 16
    Last Post: 03-20-2005, 03:07 PM