Skip to content

Instantly share code, notes, and snippets.

@evan-goode
Created March 3, 2020 00:05
Show Gist options
  • Save evan-goode/8536ac0b1b03bab0358e43c887e235c9 to your computer and use it in GitHub Desktop.
Save evan-goode/8536ac0b1b03bab0358e43c887e235c9 to your computer and use it in GitHub Desktop.
import java.io.File;
import java.io.IOException;
class PrintTempDirectory {
public static void main(String[] args) {
try {
String parent = File.createTempFile("temp-file", "tmp").getParent();
System.out.println(parent);
} catch (IOException e) {
System.out.println(e);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment