By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,002 Members | 1,020 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,002 IT Pros & Developers. It's quick & easy.

monitoring the filesystem for changes

P: n/a
hello,
i have designed a desktop search utility in python and a file system
monitoring using readdirectorychangesw 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

Jun 2 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
i have designed a desktop search utility in python and a file system
monitoring using readdirectorychangesw 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 readdirectorychangesw, 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

Jun 3 '07 #2

P: n/a
hello
well in my implementation of readdirectorychangesw 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

Jun 3 '07 #3

P: n/a
rohit wrote:
hello
well in my implementation of readdirectorychangesw 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 ReadDirectoryChangesW 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
Jun 3 '07 #4

P: n/a
You could use the ReadDirectoryChangesW 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_DIRECTORY = 0x0001
hDir = None

def __init__(self, directory):
self.hDir = win32file.CreateFile (
directory,
self.FILE_LIST_DIRECTORY,
win32con.FILE_SHARE_READ | win32con.FILE_SHARE_WRITE,
None,
win32con.OPEN_EXISTING,
win32con.FILE_FLAG_BACKUP_SEMANTICS|
win32con.FILE_FLAG_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
Jun 4 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.