Created
April 28, 2016 14:40
-
-
Save DirkHoffmann/c9ecc12eef3027910b793a696fed45f9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
// Create temp file. | |
File temp = File.createTempFile("pattern", ".suffix"); | |
// Delete temp file when program exits. | |
temp.deleteOnExit(); | |
// Write to temp file | |
BufferedWriter out = new BufferedWriter(new FileWriter(temp)); | |
out.write("aString"); | |
out.close(); | |
} catch (IOException e) { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Old code snippet for Java, the equivalent of shell
mktemp