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

15
LINES

< > BotCompany Repo | #1009093 - createTempFile

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2375L/15K).

static File createTempFile() {
  ret createTempFile("tmp", null);
}

static File createTempFile(S prefix, S suffix) ctex {
  prefix = nohup_sanitize(prefix);
  suffix = nohup_sanitize(suffix);
  if (shouldKeepTempFiles())
    ret mkdirsForFile(javaxCachesDir("Temp/" + prefix + "-" + randomID() + "-" + suffix));
  // File.createTempFile needs at least 3 prefix characters, so we
  // fíll them up for you
  File f = File.createTempFile(takeFirst(10, pad(prefix, 3, '-')), suffix);
  f.deleteOnExit();
  ret f;
}

download  show line numbers  debug dex   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, xrpafgyirdlv

No comments. add comment

Snippet ID: #1009093
Snippet name: createTempFile
Eternal ID of this version: #1009093/12
Text MD5: 252bed2ff1c5541a07debc85bc3a0d7f
Transpilation MD5: 29f2e703de696d8b866007227154bff1
Author: stefan
Category: javax / i.o.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-20 16:30:48
Source code size: 527 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 422 / 505
Version history: 11 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1009093 & http://1009093.tinybrain.de