Libraryless. Click here for Pure Java version (11163L/62K).
1 | static File backupFile(File etc f) {
|
2 | if (isDirectory(f)) fail("Is a directory: " + f);
|
3 | if (!fileExists(f)) null; |
4 | File fBackup = makeFileNameUnique(newFile(javaxBackupDir(), uniqueFileNameUsingMD5_80_v2(f2s(f)))); |
5 | copyFile(f, fBackup); |
6 | //saveTextFile(newFile(f2s(fBackup) + ".original-path"), f2s(f)); |
7 | ret fBackup; |
8 | } |
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: | 966 / 1213 |
| Version history: | 11 change(s) |
| Referenced in: | [show references] |