summaryrefslogtreecommitdiffstats
path: root/tests/common
blob: 353b12c56d354220b80a5174e2463eba14c502dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# Get the size of a file in bytes
#
# @1: filename
function get_filesize()
{
	if [[ "$(uname -s)" =~ (Linux|CYGWIN_NT-) ]]; then
		stat -c%s $1
	else
		# OpenBSD
		stat -f%z $1
	fi
}