You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by snazy <gi...@git.apache.org> on 2018/07/02 09:45:31 UTC
[GitHub] cassandra pull request #236: 9608 trunk
Github user snazy commented on a diff in the pull request:
https://github.com/apache/cassandra/pull/236#discussion_r199440701
--- Diff: src/java/org/apache/cassandra/io/util/FileUtils.java ---
@@ -106,11 +171,57 @@ public static void createHardLink(File from, File to)
}
}
+ private static final File tempDir = new File(System.getProperty("java.io.tmpdir"));
+ private static final AtomicLong tempFileNum = new AtomicLong();
+
+ public static File getTempDir()
+ {
+ return tempDir;
+ }
+
+ /**
+ * Pretty much like {@link File#createTempFile(String, String, File)}, but with
+ * the guarantee that the "random" part of the generated file name between
+ * {@code prefix} and {@code suffix} is a positive, increasing {@code long} value.
+ */
public static File createTempFile(String prefix, String suffix, File directory)
{
try
{
- return File.createTempFile(prefix, suffix, directory);
+ // Do not use java.io.File.createTempFile(), because some tests rely on the
--- End diff --
Right, I think that's reasonable.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org