aboutsummaryrefslogtreecommitdiffstats
path: root/test/readdir0.awk
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2013-11-07 22:25:22 +0200
committerArnold D. Robbins <arnold@skeeve.com>2013-11-07 22:25:22 +0200
commitdb78c6a3ccd2bfde092124eca1d3174ac3902f55 (patch)
treeec38326873548359e4d809e5cd739a072491083c /test/readdir0.awk
parent07aa3d5dafee42fcaa3eaa0370a187c5cb53570e (diff)
downloadegawk-db78c6a3ccd2bfde092124eca1d3174ac3902f55.tar.gz
egawk-db78c6a3ccd2bfde092124eca1d3174ac3902f55.tar.bz2
egawk-db78c6a3ccd2bfde092124eca1d3174ac3902f55.zip
Solaris fixes.
Diffstat (limited to 'test/readdir0.awk')
-rw-r--r--test/readdir0.awk37
1 files changed, 30 insertions, 7 deletions
diff --git a/test/readdir0.awk b/test/readdir0.awk
index c98ac674..3a114fcd 100644
--- a/test/readdir0.awk
+++ b/test/readdir0.awk
@@ -11,12 +11,35 @@ BEGIN {
}
}
-{
- ino = $1
- name = $NF
- type = substr($2, 1, 1)
- if (type == "-")
- type = "f"
+BEGIN {
+ ls_afi = "ls -afi .."
+ ls_al = "ls -la .. | sed 1d"
+
+ for (i = 1; (ls_afi | getline) > 0; i++) {
+ # inode number is $1, filename is read of record
+ inode = $1
+ $1 = ""
+ $0 = $0
+ sub(/^ */, "")
+ names[i] = $0
+ ino[names[i]] = inode
+ }
+ close(ls_afi)
+
+ for (j = 1; (ls_al | getline) > 0; j++) {
+ type_let = substr($0, 1, 1)
+ if (type_let == "-")
+ type_let = "f"
+ $1 = $2 = $3 = $4 = $5 = $6 = $7 = $8 = ""
+ $0 = $0
+ sub(/^ */, "")
+ type[$0] = type_let
+ }
+ close(ls_al)
- printf "%s/%s/%s\n", ino, name, (ftype_unknown ? "u" : type)
+ if (i != j)
+ printf("mismatch: %d from `ls -afi' and %d from `ls -l'\n", i, j) > "/dev/stderr"
+
+ for (i = 1; i in names; i++)
+ printf("%s/%s/%s\n", ino[names[i]], names[i], type[names[i]])
}