Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detect File Modified

Status
Not open for further replies.

NicoleM

Programmer
Oct 18, 2001
23
0
0
ZA
Hi

I would like to know which would use up more system resourses? My aim is to detect when a file has been modified...

a) Creating Watched Folder with FindChangeNotification
b) Polling using a timer and checking whether the file has been modified.


Thanks
 
The timer function mate as this will probably be called more often than just watching to see if the data is changed
 
I would recommend "a" - the event driven watch process. I think there are a couple of advantages, 1st - you'll get the event notification in pseudo "real time" - that is, the event will get to you, I would guess within a few hundred milliseconds of the change. The timer option would only be able to detect the change at the defined timer interval.

Further, your program (and Windows) will be interrupted to handler the timer events (messages) at even timer interval as long as the timer is active, taking away system resources from whatever else is running at the time. Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
I'm with Cajun; the timer function appraoch is hugely, hugely inefficient.
 
I'm with Cajun; the timer function approach advised by Debeast is hugely, hugely inefficient and a waste of resources, except under very finite circumstances.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top