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)

1  
static TailFile tailFilePlusLastLine(File file, int interval, fO onData) {
2  
  final TailFile tf = new TailFile(file, interval, onData);
3  
  tf.l = l(file);
4  
  fS line = lastLineOfFile(file); // TODO: race condition
5  
  thread "First Line" {
6  
    if (line != null)
7  
      pcallF(onData, line + "\n");
8  
    tf.start();
9  
  }
10  
  ret tf;
11  
}

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: 363 / 398
Version history: 8 change(s)
Referenced in: [show references]