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

11
LINES

< > BotCompany Repo | #1014119 // tailFilePlusLastLine - start with last line of existing content

JavaX fragment (include)

static TailFile tailFilePlusLastLine(File file, int interval, fO onData) {
  final TailFile tf = new TailFile(file, interval, onData);
  tf.l = l(file);
  fS line = lastLineOfFile(file); // TODO: race condition
  thread "First Line" {
    if (line != null)
      pcallF(onData, line + "\n");
    tf.start();
  }
  ret tf;
}

Author comment

Began life as a copy of #1014111

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1014119
Snippet name: tailFilePlusLastLine - start with last line of existing content
Eternal ID of this version: #1014119/9
Text MD5: 2ac635ebbd5804e5ea1d461cfc4afcbc
Author: stefan
Category: javax / i.o.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-08-26 21:03:54
Source code size: 333 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 440 / 475
Version history: 8 change(s)
Referenced in: [show references]