diff options
| author | ruki <[email protected]> | 2022-07-23 00:02:11 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-07-23 00:02:11 +0800 |
| commit | 67a7d807940ff5ebdda3a5054265422f31fca6a8 (patch) | |
| tree | f79e4ac5c5da0f255ce0bd70f7e84c6b6816275a /tests/modules | |
| parent | b9327d0744edbf212120e77b345008954eac5851 (diff) | |
add some fwatcher api
Diffstat (limited to 'tests/modules')
| -rw-r--r-- | tests/modules/fwatcher/on_created.lua | 8 | ||||
| -rw-r--r-- | tests/modules/fwatcher/on_deleted.lua | 8 | ||||
| -rw-r--r-- | tests/modules/fwatcher/on_modified.lua | 8 |
3 files changed, 24 insertions, 0 deletions
diff --git a/tests/modules/fwatcher/on_created.lua b/tests/modules/fwatcher/on_created.lua new file mode 100644 index 000000000..3dee56635 --- /dev/null +++ b/tests/modules/fwatcher/on_created.lua @@ -0,0 +1,8 @@ +import("core.base.fwatcher") + +function main(watchdir) + print("watch %s ..", watchdir) + fwatcher.on_created(watchdir, function (filepath) + print(filepath, "created") + end) +end diff --git a/tests/modules/fwatcher/on_deleted.lua b/tests/modules/fwatcher/on_deleted.lua new file mode 100644 index 000000000..b69757157 --- /dev/null +++ b/tests/modules/fwatcher/on_deleted.lua @@ -0,0 +1,8 @@ +import("core.base.fwatcher") + +function main(watchdir) + print("watch %s ..", watchdir) + fwatcher.on_deleted(watchdir, function (filepath) + print(filepath, "deleted") + end) +end diff --git a/tests/modules/fwatcher/on_modified.lua b/tests/modules/fwatcher/on_modified.lua new file mode 100644 index 000000000..834c182bf --- /dev/null +++ b/tests/modules/fwatcher/on_modified.lua @@ -0,0 +1,8 @@ +import("core.base.fwatcher") + +function main(watchdir) + print("watch %s ..", watchdir) + fwatcher.on_modified(watchdir, function (filepath) + print(filepath, "modified") + end) +end |
