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

12
LINES

< > BotCompany Repo | #1011608 // rotateLogFile - store as .partX.gz

JavaX fragment (include)

please include function appendToFile.

static void rotateLogFile(File f) {
  lock appendToFile_lock;
  if (!f.exists()) ret;
  int n = 1;
  File p;
  while ((p = newFile(f.getParentFile(), f.getName() + ".part" + n + ".gz")).exists())
    ++n;
  gzipFile(f, p);
  assertTrue(f.delete());
}

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: #1011608
Snippet name: rotateLogFile - store as .partX.gz
Eternal ID of this version: #1011608/4
Text MD5: df0bb21391938f29d43033ab68dabf2c
Author: stefan
Category: javax / io
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-05 09:32:49
Source code size: 300 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 498 / 485
Version history: 3 change(s)
Referenced in: [show references]