1 | static File makeDirNameUnique_startWithOne(File f) { |
2 | File orig = f; |
3 | int n = 1; |
4 | S name = orig.getName(); |
5 | f = new File(dirOfFile(orig), name + "." + n); |
6 | while (f.exists()) |
7 | f = new File(dirOfFile(orig), name + (++n)); |
8 | ret f; |
9 | } |
Began life as a copy of #1016338
download show line numbers debug dex old transpilations
Travelled to 12 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1019315 |
Snippet name: | makeDirNameUnique_startWithOne (uses .1, .2, ...) |
Eternal ID of this version: | #1019315/6 |
Text MD5: | ca97fbcc3b391c0ca61acda40767404b |
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:08 |
Source code size: | 247 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 310 / 348 |
Version history: | 5 change(s) |
Referenced in: | [show references] |