monitoring the filesystem for changes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rohit

    monitoring the filesystem for changes

    hello,
    i have designed a desktop search utility in python and a file system
    monitoring using readdirectorych angesw from win32api but for eg. it
    has a high cpu utilization (using a 2GHz processor).
    a solution ntfs change journal proposed here works only for ntfs
    partitions
    is there another low (processor) cost alternative that works on fat32
    partitions as well.
    Rohit

  • momobear

    #2
    Re: monitoring the filesystem for changes

    i have designed a desktop search utility in python and a file system
    monitoring using readdirectorych angesw from win32api but for eg. it
    has a high cpu utilization (using a 2GHz processor).
    I don't think so. I just build a service to monitor a directory
    changes using readdirectorych angesw, the cpu usage is not above 1.9%
    for this service(my computer's cpu is 1.7GHz). if you still think 1.9%
    is high cpu utilization, I think you can use the c to implements this
    function, the cpu usage seems none for this application(I tried c dll
    solution first).
    Wish this help to you.

    Wang Wei

    Comment

    • rohit

      #3
      Re: monitoring the filesystem for changes

      hello
      well in my implementation of readdirectorych angesw i am using
      threading that is multiple programs run simultaneously each program
      monitoring one drive for changes.
      is their a way around this...one program for all drives?
      thanks
      rohit

      Comment

      • Tim Golden

        #4
        Re: monitoring the filesystem for changes

        rohit wrote:
        hello
        well in my implementation of readdirectorych angesw i am using
        threading that is multiple programs run simultaneously each program
        monitoring one drive for changes.
        is their a way around this...one program for all drives?
        thanks
        You could use the ReadDirectoryCh angesW in overlapped
        mode. I've never tried it, so I don't know how
        robust it would be. Why is it a problem to have
        "multiple programs" running? And is that simply
        multiple threads, or multiple processes?

        TJG

        Comment

        • momobear

          #5
          Re: monitoring the filesystem for changes

          You could use the ReadDirectoryCh angesW in overlapped
          mode. I've never tried it, so I don't know how
          robust it would be. Why is it a problem to have
          "multiple programs" running? And is that simply
          multiple threads, or multiple processes?
          I used overlapped in my program, it runs about 1 week, seems no
          problems now.
          FILE_LIST_DIREC TORY = 0x0001
          hDir = None

          def __init__(self, directory):
          self.hDir = win32file.Creat eFile (
          directory,
          self.FILE_LIST_ DIRECTORY,
          win32con.FILE_S HARE_READ | win32con.FILE_S HARE_WRITE,
          None,
          win32con.OPEN_E XISTING,
          win32con.FILE_F LAG_BACKUP_SEMA NTICS|
          win32con.FILE_F LAG_OVERLAPPED,
          None
          )
          but I didn't try use multiple program do the same action. I think only
          one thread to do directory monitor is enough. other thread and process
          can communicate with it use thread or process communication.

          Wang Wei


          Comment

          Working...