Introduction
Every Operating System has it’s own location for storing temporary files. In UNIX/Linux this is /tmp. In Windows it’s C:\temp.
The example below shows how it can be done in the (platform independent way with Java:
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) { }
Love to spend time near Sea !