| 1 |
# SPDX-License-Identifier: BSD-3-Clause |
| 2 |
|
| 3 |
# Get the size of a file in bytes |
| 4 |
# |
| 5 |
# @1: filename |
| 6 |
function get_filesize() |
| 7 |
{ |
| 8 |
if [[ "$(uname -s)" =~ (Linux|CYGWIN_NT-|GNU) ]]; then |
| 9 |
stat -c%s "$1" |
| 10 |
else |
| 11 |
# OpenBSD |
| 12 |
stat -f%z "$1" |
| 13 |
fi |
| 14 |
} |