Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Need to monitor file activity (without scanning with FindFirst)

Posted on 2009-05-05
8
Medium Priority
?
681 Views
Last Modified: 2013-11-23
I need to monitor and log file activity in a directory tree for a timesheets program. My old version simply scanned the entire tree and logged the file info that had changed (either created or modified). However, this is becoming unworkable due to the ever expanding tree. Is there a way to link into some notification mechanism so that my app could stop the periodic (and now time-consuming) scans. I'd like to have it behave like the Windows Explorer which somehow knows that a new file has been added to a folder and uses that notification to update its file list.
0
Comment
Question by:BradKilmer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
8 Comments
 
LVL 13

Expert Comment

by:ThievingSix
ID: 24311017
0
 

Author Comment

by:BradKilmer
ID: 24311287
Oops. I take it back. That's not what I'm looking to do. I downloaded and installed the TSHChangeNotify component and did a few file operations within Windows Explorer and they were logged as expected. I thought that was the answer; however, I was wanting to receive notifications whenever ANY application modified files within a specified tree. I want to log the name all files being created/deleted/modified by any app; the only event logged by this component when a non-shell file operation is performed is the UpdateDir (and that's only when you have the Windows Explorer opened to the folder where the affected files reside, and I've already observed 2 failures to log even that).
Still looking...
0
 
LVL 13

Expert Comment

by:ThievingSix
ID: 24311322
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:BradKilmer
ID: 24311665
That's closer. The events are fired when the specified changes occur (from any app), but I need to get the file names that trigger the change events; I can't see where the filename information is accessible at any point during the event processing. Therefore, I would still have to scan the directory tree being monitored to see what change triggered the event: scanning the directory tree brings me back to square one (that's what I'm trying to get away from). Thanks for your help, but I'm thinking that my best option is to optimize my existing code so that scans the directory tree in short bursts and stops locking up the main VCL thread for tens of seconds at a time; it doesn't have to scan that rapidly, just constantly.

Thanks
BK
0
 
LVL 13

Accepted Solution

by:
ThievingSix earned 2000 total points
ID: 24311877
Alright, I got it!

http://www.torry.net/vcl/filedrv/notification/urdirmonitoring.zip

That download will give you the file DirMonitoring_d5.dpk. Open it to install the component.

For me the requires for it were not correct.

I saw:

requires
  vcl50,
  Vclx50;

I needed to remove the "50" from each for it to work. I ran the demo application and watched C:\ and renamed a file from the explorer and from another program. Should work.
0
 

Author Comment

by:BradKilmer
ID: 24315333
PERFECT!
Thanks!
BK
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question