Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Monitoring files

Monitoring files

Scheduled Pinned Locked Moved C / C++ / MFC
c++delphihelpquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dArK cHAriSmA
    wrote on last edited by
    #1

    Hi all! With your help, I would like to write a program that monitors which ever files system opens, creates, writes to, reads from .... and finaly updates those neatly in it's log - same as any antivirus monitor but without virus-checking. I've written a code that uses ReadDirectoryChangesW, but it only triggers when file is launched or date/time modified. Which function should I use? It's important that my program should 'be aware' when any other program reads from certain file (ie. catch the name of INI file being read from). I hope that I was clear. I've downloaded some projects, but they didn't do. I'm using Borland C++ 5.0. Thanx

    dArK cHAriSmA

    A H 2 Replies Last reply
    0
    • D dArK cHAriSmA

      Hi all! With your help, I would like to write a program that monitors which ever files system opens, creates, writes to, reads from .... and finaly updates those neatly in it's log - same as any antivirus monitor but without virus-checking. I've written a code that uses ReadDirectoryChangesW, but it only triggers when file is launched or date/time modified. Which function should I use? It's important that my program should 'be aware' when any other program reads from certain file (ie. catch the name of INI file being read from). I hope that I was clear. I've downloaded some projects, but they didn't do. I'm using Borland C++ 5.0. Thanx

      dArK cHAriSmA

      A Offline
      A Offline
      azonenberg
      wrote on last edited by
      #2

      There are two options I can think of: * Write a file system driver * Poll the file system at regular intervals (probably about 100 ms) - attempt to open the file with exclusive access. If it fails, then someone else is using it. If it succeeds, close it because it's not in use. This option is a lot easier to code, but uses more CPU. -- modified at 0:06 Tuesday 16th October, 2007

      1 Reply Last reply
      0
      • D dArK cHAriSmA

        Hi all! With your help, I would like to write a program that monitors which ever files system opens, creates, writes to, reads from .... and finaly updates those neatly in it's log - same as any antivirus monitor but without virus-checking. I've written a code that uses ReadDirectoryChangesW, but it only triggers when file is launched or date/time modified. Which function should I use? It's important that my program should 'be aware' when any other program reads from certain file (ie. catch the name of INI file being read from). I hope that I was clear. I've downloaded some projects, but they didn't do. I'm using Borland C++ 5.0. Thanx

        dArK cHAriSmA

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        See FindFirstChangeNotification and How to get a notification if change occurs in a specified directory [^].

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups