Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

15
LINES

< > BotCompany Repo | #1010992 // onFileChange

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (10899L/60K).

svoid onFileChange(double seconds, File file, long lastModificationSeen default modificationTime(file), Runnable r) {
  doEvery_daemon(toMS(seconds), new Runnable {
    long lastMod = lastModificationSeen;
    
    run {
      long mod = modificationTime(file);
      if (mod != lastMod) {
        lastMod = mod;
        call(r);
      }
    }
  });
  
  call(r);
}

Author comment

Began life as a copy of #1004395

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1010992
Snippet name: onFileChange
Eternal ID of this version: #1010992/5
Text MD5: 93ea3251732b00ce9f577f5461785d04
Transpilation MD5: 19c14fa51b549209b85a313596bb4bd7
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2024-07-14 01:59:56
Source code size: 379 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 519 / 586
Version history: 4 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1010993 - onFileChangeAndNow