Libraryless. Click here for Pure Java version (2210L/14K).
static File renameFileBaseName(File f, S newBaseName) { S ext = fileExtension(f); S base = dropSuffix(ext, fileName(f)); File f2 = fileInSameDir(f, newBaseName + ext); if (eq(f, f2)) ret f; if (!renameFile(f, f2)) null; ret f2; }
Began life as a copy of #1002706
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1026403 |
Snippet name: | renameFileBaseName - rename file, keep extension |
Eternal ID of this version: | #1026403/5 |
Text MD5: | 9f907c292ce0e80a51a34996c3692bed |
Transpilation MD5: | 91ffea045070b34b9f0bee6cef71bb43 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-01-02 14:22:29 |
Source code size: | 248 bytes / 8 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 188 / 302 |
Version history: | 4 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) |