summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it.class12
1 files changed, 12 insertions, 0 deletions
diff --git a/it.class b/it.class
index 3846fe5..a9b6662 100644
--- a/it.class
+++ b/it.class
@@ -1082,4 +1082,16 @@ static function mod($a, $n)
return (($a % $n) + $n) % $n;
}
+/**
+ * Same as php tempnam() but $dir defaults to tmp/ in service home
+ */
+static function tempnam($dir, $prefix)
+{
+ $dir = $dir ?: $GLOBALS['ULTRAHOME'] . "/tmp";
+ if (!is_writable($dir))
+ it::error("tempnam: '$dir' not writable");
+
+ return tempnam($dir, $prefix);
+}
+
}