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

13
LINES

< > BotCompany Repo | #1015626 // watchFile

JavaX fragment (include)

static java.util.Timer watchFile(final File f, int interval, final Runnable onChange) {
  ret doEvery(interval, new Runnable {
    FileStatus status = fileStatus(f);
    
    public void run {
      FileStatus s = fileStatus(f);
      if (neq(s, status)) {
        status = s;
        pcallF(onChange);
      }
    }
  });
}

Author comment

Began life as a copy of #1013001

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: #1015626
Snippet name: watchFile
Eternal ID of this version: #1015626/3
Text MD5: e32ee22e54071c458d665bda514dcb1b
Author: stefan
Category: javax / i.o.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-20 12:20:10
Source code size: 336 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 326 / 350
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)