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

9
LINES

< > BotCompany Repo | #1020319 // makeDirNameUnique_startWithOne_noDot (uses name1, name2, ...)

JavaX fragment (include)

static File makeDirNameUnique_startWithOne_noDot(File f) {
  File orig = f;
  int n = 1;
  S name = orig.getName();
  f = new File(dirOfFile(orig), name + n);
  while (f.exists())
    f = new File(dirOfFile(orig), name + (++n));
  ret f;
}

Author comment

Began life as a copy of #1019315

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1020319
Snippet name: makeDirNameUnique_startWithOne_noDot (uses name1, name2, ...)
Eternal ID of this version: #1020319/3
Text MD5: 07250b93afcc5cdbcb6918e5d9bcb8db
Author: stefan
Category: javax / io
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-12-14 13:06:37
Source code size: 247 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 204 / 240
Version history: 2 change(s)
Referenced in: [show references]