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

8
LINES

< > BotCompany Repo | #1002706 // renameFile - smarter version of File.renameTo()

JavaX fragment (include)

static bool renameFile(File a, File b) {
  mkdirsForFile(b);
  ret a.renameTo(b);
}

static bool renameFile(File a, S newName) {
  ret renameFile(a, fileInSameDir(a, newName));
}

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: #1002706
Snippet name: renameFile - smarter version of File.renameTo()
Eternal ID of this version: #1002706/9
Text MD5: f73d160691c7867df390342310baf00c
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-08 12:44:53
Source code size: 185 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 723 / 813
Version history: 8 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1011776 - renameFile_assertTrue
#1015146 - moveFileToDir
#1015320 - moveFile - smarter version of File.renameTo(); asserts success. second argument is a target FILE NAME, not the DIR to put it in
#1018668 - renameFileIfExists
#1024948 - renameFileVerbose
#1026403 - renameFileBaseName - rename file, keep extension
#3000382 - Answer for ferdie (>> t = 1, f = 0)