Solved

monitor folders for files added, removed, renamed in a thead

Posted on 2007-11-16
9
965 Views
Last Modified: 2008-12-03
Hi all, I want to be able to do a system wide hook on all files and folders copied, renamed,  removed, created or deleted....
I need to do it in a thread and get the changes added to a listbox or something so I can do what I want with them with stopping it capturing the file/folder changes still.
I have tried a couple of components, but none of them seem to capture all the files.
For example, I copy a folder from one drive to another drive with loads of small files inside it, It seems to get a few of them, but looses all the rest.

Anyone want to post me some code up so I can get started on the program I want to do.

Cheers


0
Comment
Question by:satmanuk
  • 3
  • 3
  • 3
9 Comments
 
LVL 19

Expert Comment

by:MerijnB
Comment Utility
you want this system wide?
0
 
LVL 1

Author Comment

by:satmanuk
Comment Utility
well across all the drives.
Or even be able to just monitor a load or folders at the same time.
0
 
LVL 16

Expert Comment

by:CodedK
Comment Utility
Hi satmanuk

You can try this component :
http://www.torry.net/authorsmore.php?id=4053

This is a Windows API based component for monitoring any changes in specified local or remote folder. Unlike other Directory Monitors, this one doesn't lose events, even remote.

Monitored Events:

    * File/Folder Creation, Modify, Change, Deletion, Rename.
    * Security changes.
    * A single notification for every event.
    * Subdirectory notification.
    * The event receives the Path + File Name affected and selected Action.
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
0
 
LVL 19

Expert Comment

by:MerijnB
Comment Utility
did you to use something like this: http://atorg.net.ru/delphi/atfilenotification.htm ?
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 19

Expert Comment

by:MerijnB
Comment Utility
both probably use FindFirstChangeNotification  internally, did you use something like that yourself already?
0
 
LVL 16

Accepted Solution

by:
CodedK earned 250 total points
Comment Utility
I think one of the best is this :
http://www.delphi.com.ar/vcl/ShellNotify.zip
    * File type association has changes;
    * File attributes changes;
    * A non-folder item creation / deletion / rename;
    * A non-folder item deletion;
    * Drive insertion / removed;   <----
    * Drive insertion and the Shell should create a new window for the drive;   <----
    * Storage media has been inserted / removed;   <----
    * Folder Creation / Deletion / Renamed;
    * Folder Sharings / Unsharing;   <----
    * Network Disconnection;   <----
    * The contents of an existing folder changes;
    * An image in the system image list changes;   <----
    * An existing nonfolder item changes, but the item still exists and has not been renamed.    <----
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--~-~-~-~-~

Here you can find many components for this :
http://www.torry.net/pages.php?id=252
0
 
LVL 1

Author Comment

by:satmanuk
Comment Utility
i want to be able tomonitor multiple drives and folders, i would have to have a folder monitor creater for each drive or folder with most of the components i have seen so far.
I need to be able to select a load of drives or folder and monitor them all the time for changes and aditions.
I have looked a the dir mon component, but i found it dropped to many files in my few test with it.
i looked at ShellNotify and this seemed to do what i needed on a XP box, but onc i added a few folders to it to monitor, i found i missed files when i copied them from drive to drive

I wondered if it was because i was using Delphi 2007, but tried in in my old delphi 6 and get the same results..

Strange.
0
 
LVL 1

Author Comment

by:satmanuk
Comment Utility
not to worry, i seem to have got the shellnotify to collect the data..... Delphi 6 worked.

0
 
LVL 16

Expert Comment

by:CodedK
Comment Utility
Why C Satmanuk?
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
PDF library for Delphi 2 89
Syntax Check Delphi Seattle IOS app without MAC ? 1 83
Simple Delphi Question 9 77
Delphi Form ownership 4 50
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now