Difference between revisions of "ATFileNotif"

From Lazarus wiki
Jump to navigationJump to search
m (Fixed syntax highlighting)
 
(One intermediate revision by one other user not shown)
Line 7: Line 7:
 
Example of function which starts file watch:
 
Example of function which starts file watch:
  
<syntaxhighlight>
+
<syntaxhighlight lang="pascal">
 
procedure TfmMain.NotifyFile;
 
procedure TfmMain.NotifyFile;
 
begin
 
begin
Line 26: Line 26:
 
=License=
 
=License=
 
MPL 2.0 or LGPL.
 
MPL 2.0 or LGPL.
 +
 +
 +
[[Category:Components]]

Latest revision as of 10:00, 9 February 2020

About

ATFileNotif is simple component which detects file change. It uses timer, timer checks are file props (file exists; file size; file age) changed or not. It calls OnChanged.

atfilenotif.png

Example

Example of function which starts file watch:

procedure TfmMain.NotifyFile;
begin
  with ATFileNotif1 do
  begin
    Timer.Enabled:= False;
    Timer.Interval:= 1000;
    FileName:= edFileName.Text;
    Timer.Enabled:= True;
  end;
end;

Download

Github: https://github.com/Alexey-T/ATFileNotif-Lazarus

License

MPL 2.0 or LGPL.