1 | static File makeFileNameUnique(File f) { |
2 | File orig = f; |
3 | int n = 0; |
4 | while (f.exists()) |
5 | f = new File(dirOfFile(orig), orig.getName() + "." + ++n); |
6 | ret f; |
7 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1015318 |
Snippet name: | makeFileNameUnique |
Eternal ID of this version: | #1015318/1 |
Text MD5: | 23dc5e1fa6d7ca6b5295d748872cd67f |
Author: | stefan |
Category: | javax / io |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-05-12 22:33:44 |
Source code size: | 171 bytes / 7 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 387 / 420 |
Referenced in: | [show references] |