Libraryless. Click here for Pure Java version (10907L/78K).
1 | !7 |
2 | |
3 | module RecursiveFileWatchServiceSpike > DynPrintLog {
|
4 | switchable File dir; |
5 | switchable bool verbose; |
6 | |
7 | transient bool started; |
8 | |
9 | start {
|
10 | if (dir == null) dir = javaxDataDir(); |
11 | thread "Starting" {
|
12 | print("Starting watch service on " + dir);
|
13 | WatchService watchService = jdk_watchService_start(); |
14 | jdk_watchService_registerRecursivePath(dir, voidfunc(File f) enter {
|
15 | if (verbose) print("File changed: " + f);
|
16 | vmBus_send('fileChanged, f);
|
17 | }); |
18 | print("Listening to changes in " + dir);
|
19 | started = true; |
20 | } |
21 | } |
22 | } |
Began life as a copy of #1019346
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
| Snippet ID: | #1019349 |
| Snippet name: | Recursive File Watch Service Spike [OK] |
| Eternal ID of this version: | #1019349/9 |
| Text MD5: | 2d77298961eb15e273481851f058292a |
| Transpilation MD5: | 8c060454773dd9ff57d9485e20730a51 |
| Author: | stefan |
| Category: | javax / io |
| Type: | JavaX source code (Dynamic Module) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2020-01-22 15:10:56 |
| Source code size: | 599 bytes / 22 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 613 / 6268 |
| Version history: | 8 change(s) |
| Referenced in: | [show references] |