Component for tracking changes in the directory contents and generating events/triggers if such changes occur. Following events/triggers are available: create, delete, change, rename.
Case study:
- No API.
Program for automatic counting of plant embryos. It is necessary to acquire data from the scanner which has no API. Scanner is saving the files into a certain folder. As soon as a new scan appears in the folder, PBDirectoryMonitor tells the main program that new scans are available. The main program can now process them.
- Anti-piracy or fool-proofing.
Program for testing high pressure pumps. It is necessary to prevent files, which are important for the program to work, from unauthorized modifications like being changed or deleted. PBDirectoryMonitor signals about such changes. The main program decides to set all IO-devices gently back to their idle values and exits with corresponding error message.
Prerequirements
OS compatibility
7 SP2 x64 |
8 x64 |
8.1 x64 |
10 x64 |
11 x64 |
RAD Studio compatibility
Delphi |
---|
10 Seattle |
10.1 Berlin |
10.2 Tokyo |
10.3 Rio |
10.4 Sydney |
11 Alexandria |
1 user
3 users
5 users
10 users
Site license
Free components in a bundle
Buy a bundle now and enjoy all new component releases for free during the update period. |
Keep track of multiple versions
You will get access to all older versions and a detailed changelog. |
Free new features
Get all new component features for free during the free update period. |
Install once use forever
Our products are not time limited. |
Source code promise
In case our component will become obsolete and we no longer support it, we will provide you its source code. So you don’t have to worry about a replacement. |
References:
> QSG code example provided with the installer
After installation, a group PyBridge will appear in the Tool Palette of Delphi, where you can find the new component PBDirectoryMonitor.
The new component PBDirectoryMonitor can be found in the Tool Palette under PyBridge group
Place TPBDirectoryMonitor on the form and set up its main properties:
- AutoStart – set to True to start monitoring automatically
- FolderName – path to the folder, which should be monitored
- InvertSelection – set to True to monitor all files and folders, except those listed under MonitoredFiles
- MonitoredFiles – a list of filenames to monitor. Default (empty list) – all files and folders will be monitored. Instead of names, you can provide a list of masks in accordance with System.Masks
Now PBDirectoryMonitor is ready to be used. To demonstrate how it works, let’s add buttons and Memo to the form and do some operations with files and folders inside the monitored FolderName.
Application layout to demonstrate basic PBDirectoryMonitor functions
Create an OnFileCreate event handler
1 2 3 4 |
procedure TDirectoryMonitorDemo.PBDirectoryMonitor1FileCreate(const FileName: string); begin Memo1.Lines.Add('File Create: ' + FileName); end; |
Create an OnFolderRename event handler
1 2 3 4 |
procedure TDirectoryMonitorDemo.PBDirectoryMonitor1FolderCreate(const FileName: string); begin Memo1.Lines.Add('Folder Create: ' + FileName); end; |
Run the program. Now when you change the content of the monitored folder you will get corresponding notifications. Create a new text file “New Text Document.txt” in the monitored folder. Create a new folder “NewFolder”.
Create a new text file “New Text Document.txt”. Create a new folder “NewFolder”
This example demonstrates how you can easily and quickly monitor changes of files and folders with a help of PBDirectoryMonitor component. Now you can also enjoy the full power of PBDirectoryMonitor in your applications!