libtpms/tests/common
Stefan Berger eb8a76807a tests: Use double quotes on command parameters (shellcheck)
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2023-03-02 09:32:38 -05:00

15 lines
228 B
Plaintext

# SPDX-License-Identifier: BSD-3-Clause
# 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
}