diff --git a/bin/padto b/bin/padto index cf4d29694..eb4deb7cb 100755 --- a/bin/padto +++ b/bin/padto @@ -2,6 +2,10 @@ totalsize=$1 outfile=$2 -filesize=`stat -f "%z" "$outfile"` + +[[ "$OSTYPE" == "linux-gnu" ]] \ + && filesize=$(stat -c "%s" "$outfile") \ + || filesize=$(stat -f "%z" "$outfile") + padsize=$((512-$filesize)) dd if=/dev/zero bs=1 count=$padsize >> "$outfile"