We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 04d8aa4 commit 57ee9efCopy full SHA for 57ee9ef
test/tools/libtest.sh
@@ -138,6 +138,20 @@ tty_reset()
138
fi
139
}
140
141
+tempfile_name()
142
+{
143
+ temp_base="${1:-tempfile}"
144
+ if which mktemp >/dev/null 2>&1; then
145
+ temp_file="$(mktemp "$tmp_dir/${temp_base}.XXXXXX")"
146
+ else
147
+ temp_file="$tmp_dir/${temp_base}.$$"
148
+ while [ -e "$temp_file" ]; do
149
+ temp_file="${temp_file}.alt"
150
+ done
151
+ fi
152
+ printf '%s\n' "$temp_file"
153
+}
154
+
155
file() {
156
path="$1"; shift
157
0 commit comments