Solved

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

Posted on 2007-11-16
9
970 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
ID: 20298618
you want this system wide?
0
 
LVL 1

Author Comment

by:satmanuk
ID: 20298678
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
ID: 20298920
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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 19

Expert Comment

by:MerijnB
ID: 20298930
did you to use something like this: http://atorg.net.ru/delphi/atfilenotification.htm ?
0
 
LVL 19

Expert Comment

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

Accepted Solution

by:
CodedK earned 250 total points
ID: 20299078
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
ID: 20309169
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
ID: 20309212
not to worry, i seem to have got the shellnotify to collect the data..... Delphi 6 worked.

0
 
LVL 16

Expert Comment

by:CodedK
ID: 20309248
Why C Satmanuk?
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help on project with Soap 10 54
QRReport  TQrmemo vertical stretching 1 47
can't find the executable in Simulator 1 94
Delphi problems to abort a printjob 9 21
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

831 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