summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2015-05-22 20:24:18 +0200
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2015-05-22 20:24:18 +0200
commit93ada9cdf781d30226a5a55acedee04640d044b4 (patch)
tree2d4562895f3e9da3347b84bd28921f3c84b7dc30 /scripts
parentb26d9839c9fd358d75ef8072931b3250cbe730ed (diff)
add wrapper for stat
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/stat19
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/stat b/scripts/stat
new file mode 100755
index 000000000..bf9136338
--- /dev/null
+++ b/scripts/stat
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+declare -a opts
+while [[ "$1" ]]; do
+ case "$1" in
+ -c) shift ;;
+ -f) shift ;;
+ *) opts+=("$1") ;;
+ esac
+ shift
+done
+
+if /usr/bin/stat -qs .>/dev/null 2>&1; then
+ /usr/bin/stat -f %z "${opts[@]}"
+else
+ /usr/bin/stat -c %s "${opts[@]}"
+fi