diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2012-05-09 20:31:35 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2012-05-09 20:31:35 +0300 |
commit | a59319732d89feda419acab674ea580c95db7d4a (patch) | |
tree | 3d30595e8f50cb1b486c9f61f93a498834c22842 /test/filefuncs.awk | |
parent | 8ff0b4eaa7592280b5a55087c0326c6ef1f88db5 (diff) | |
parent | c41908d0b02f7746a67ab7aa2e54058e5b66439a (diff) | |
download | egawk-a59319732d89feda419acab674ea580c95db7d4a.tar.gz egawk-a59319732d89feda419acab674ea580c95db7d4a.tar.bz2 egawk-a59319732d89feda419acab674ea580c95db7d4a.zip |
Merge branch 'xgawk'
Diffstat (limited to 'test/filefuncs.awk')
-rw-r--r-- | test/filefuncs.awk | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/filefuncs.awk b/test/filefuncs.awk new file mode 100644 index 00000000..aa532741 --- /dev/null +++ b/test/filefuncs.awk @@ -0,0 +1,25 @@ +@load "filefuncs" + +BEGIN { + if (chdir("..") < 0) { + printf "Error: chdir failed with ERRNO %s\n", ERRNO + exit 1 + } + + if (stat(ARGV[0], st) < 0) { + printf "Error: stat(%s) failed with ERRNO %s\n", ARGV[0], ERRNO + exit 1 + } + + nf = split("name dev ino mode nlink uid gid size blocks atime mtime ctime pmode type", f) + + for (i = 1; i <= nf; i++) { + if (!(f[i] in st)) { + printf "stat value for %s is missing\n",f[i] + rc = 1 + } + else + delete st[f[i]] + } + exit rc+0 +} |