# If $1 is 'infinity', output forever or until the receiving pipe stops reading,
# whichever comes first.
generate_zero_bytes () {
- perl -e 'if ($ARGV[0] == "infinity") {
- while (-1) {
- print "\0"
- }
- } else {
- print "\0" x $ARGV[0]
- }' "$@"
+ test-tool genzeros "$@"
}
# In some bourne shell implementations, the "unset" builtin returns
fi
}
+# Check if the file exists and has a size greater than zero
+test_file_not_empty () {
+ if ! test -s "$1"
+ then
+ echo "'$1' is not a non-empty file."
+ false
+ fi
+}
+
test_path_is_missing () {
if test -e "$1"
then