ATFileNotif: what changed
Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | - | ||
| 2 | - | ||
| 3 | - | ||
| 4 | - | ||
| 5 | - | ||
| 6 | - | ||
| 7 | - | ||
| 8 | 1 | # About | |
| 9 | 2 | ||
| 10 | - | ||
| 3 | + | 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. | |
| 11 | 4 | ||
| 12 | - | ||
| 5 | + |  | |
| 13 | 6 | ||
| 14 | 7 | # Example | |
| 15 | 8 | ||
| 16 | - | ||
| 17 | - | ||
| 9 | + | Example of function which starts file watch: | |
| 10 | + | ||
| 11 | + | ``` pascal | |
| 18 | 12 | procedure TfmMain.NotifyFile; | |
| 19 | - | ||
| 20 | - | ||
| 21 | - | ||
| 22 | - | ||
| 23 | - | ||
| 24 | - | ||
| 25 | - | ||
| 26 | - | ||
| 27 | - | ||
| 13 | + | begin | |
| 14 | + | with ATFileNotif1 do | |
| 15 | + | begin | |
| 16 | + | Timer.Enabled:= False; | |
| 17 | + | Timer.Interval:= 1000; | |
| 18 | + | FileName:= edFileName.Text; | |
| 19 | + | Timer.Enabled:= True; | |
| 20 | + | end; | |
| 21 | + | end; | |
| 28 | 22 | ``` | |
| 29 | 23 | ||
| 30 | 24 | # Download | |
| 31 | 25 | ||
| 32 | 26 | Github: <https://github.com/Alexey-T/ATFileNotif-Lazarus> | |
| 33 | 27 | ||
| 34 | 28 | # License | |
| 35 | 29 | ||
| 36 | 30 | MPL 2.0 or LGPL. | |
| 37 | 31 | ||
| 38 | 32 | --- | |
| 39 | - | ||
| 33 | + | *From the Free Pascal wiki, page "ATFileNotif", as it stood on 2020-02-09 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* | |
| 34 | + | Category: Components |
