Solved

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

Posted on 2007-11-16
9
972 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
delphi exception 7 68
Delphi Form ownership 4 114
Print Graphic and Text to Epson TM-T88v 12 389
How to remove Recent Projects from Embarcadero C++ builder XE10. Berlin 2 66
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

828 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