Fix bug in File.createTempFile

This commit is contained in:
Alexey Andreev 2017-11-16 13:57:41 +03:00
parent 7e422c081e
commit aa48a097d2

View File

@ -508,10 +508,10 @@ public class TFile implements Serializable, Comparable<TFile> {
if (directory == null) { if (directory == null) {
String tmpDir = System.getProperty("java.io.tmpdir", "."); String tmpDir = System.getProperty("java.io.tmpdir", ".");
tmpDirFile = new TFile(tmpDir); tmpDirFile = new TFile(tmpDir);
tmpDirFile.mkdirs();
} else { } else {
tmpDirFile = directory; tmpDirFile = directory;
} }
tmpDirFile.mkdirs();
TFile result; TFile result;
do { do {
result = genTempFile(prefix, newSuffix, tmpDirFile); result = genTempFile(prefix, newSuffix, tmpDirFile);