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

8
LINES

< > BotCompany Repo | #1020616 // backupFile - back-up a file to a standard location

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (11163L/62K).

static File backupFile(File etc f) {
  if (isDirectory(f)) fail("Is a directory: " + f);
  if (!fileExists(f)) null;
  File fBackup = makeFileNameUnique(newFile(javaxBackupDir(), uniqueFileNameUsingMD5_80_v2(f2s(f))));
  copyFile(f, fBackup);
  //saveTextFile(newFile(f2s(fBackup) + ".original-path"), f2s(f));
  ret fBackup;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 9 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1020616
Snippet name: backupFile - back-up a file to a standard location
Eternal ID of this version: #1020616/12
Text MD5: 891fc4c0f197890c0d9d0df56312e652
Transpilation MD5: 0bce685df937e92ec3e83761a2bb9961
Author: stefan
Category: javax / io
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2023-06-02 22:38:57
Source code size: 334 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 304 / 418
Version history: 11 change(s)
Referenced in: [show references]