CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2005
    Posts
    1

    Question File Monitoring (Read,Write etc...) monitoring system.

    I need to develop a system to monitor operations performed on files/folders.
    Such as
    1. open,
    2. read,
    3. write,
    4. close,
    5. copy,
    6 rename,and
    7. move


    I have stumbled upon one solution.

    Having a "File System Filter Driver" which monitors every atomic operation performed on the file system. But the information available out of the driver is too huge to classify into a single user operation.

    For example
    (*) IRP_MJ_WRITE is the Major function getting initiated when a user tries to write a file.
    (*) However more than one IRP_MJ_WRITE happens for a single write.
    (*) when user saves the document twice,it is difficult for me to group the IRP_MJ_WRITE's into TWO user writes.


    Someone help me on how to proceed on this, or may be any other solution to this problem.

  2. #2
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    153

    Re: File Monitoring (Read,Write etc...) monitoring system.

    Hi,

    if you can use Win-API, take a look at "ReadDirectoryChangesW" in the MSDN.
    This works fine and uncomplicated.

    Hope this helps,
    Matze

  3. #3
    Join Date
    Sep 2002
    Location
    14° 39'19.65"N / 121° 1'44.34"E
    Posts
    9,815

    Re: File Monitoring (Read,Write etc...) monitoring system.

    Quote Originally Posted by Madhan_Saran
    I need to develop a system to monitor operations performed on files/folders.
    You might also take a look at FindFirstChangeNotification() / FindNextChangeNotification().

  4. #4
    Join Date
    Aug 2002
    Location
    Cluj-Napoca,Romania
    Posts
    3,496

    Re: File Monitoring (Read,Write etc...) monitoring system.

    Quote Originally Posted by matze42
    Hi,

    if you can use Win-API, take a look at "ReadDirectoryChangesW" in the MSDN.
    This works fine and uncomplicated.

    Hope this helps,
    Matze
    The only drawback of the function is that it is not available for Win 9x systems. Also, the drive being monitored must have NTFS file system.
    Har Har

  5. #5
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652

    Re: File Monitoring (Read,Write etc...) monitoring system.

    Quote Originally Posted by Madhan_Saran
    I need to develop a system to monitor operations performed on files/folders.
    Is there any special reason why you need to re-invent the wheel?

  6. #6
    Join Date
    May 2005
    Posts
    121

    Re: File Monitoring (Read,Write etc...) monitoring system.

    Quote Originally Posted by PadexArt
    The only drawback of the function is that it is not available for Win 9x systems. Also, the drive being monitored must have NTFS file system.
    Neither of these things are much of a drawback these days!!

    Markus

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured