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

5
LINES

< > BotCompany Repo | #1023098 // backupTextFile - backup file if different from new contents

JavaX fragment (include)

svoid backupTextFile(File f, S text) {
  long size = fileSize(f);
  if (size != 0 && (size != lUtf8(text) || !eq(loadTextFile(f), text)))
    backupFile(f);
}

Author comment

Began life as a copy of #1023097

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1023098
Snippet name: backupTextFile - backup file if different from new contents
Eternal ID of this version: #1023098/1
Text MD5: 29b41a1dd9986a74882892e613c5f452
Author: stefan
Category: javax / io
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-05-05 18:12:07
Source code size: 162 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 168 / 209
Referenced in: [show references]