aboutsummaryrefslogtreecommitdiffstats
path: root/test/readdir0.awk
diff options
context:
space:
mode:
Diffstat (limited to 'test/readdir0.awk')
-rw-r--r--test/readdir0.awk22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/readdir0.awk b/test/readdir0.awk
new file mode 100644
index 00000000..c98ac674
--- /dev/null
+++ b/test/readdir0.awk
@@ -0,0 +1,22 @@
+BEGIN {
+ while ((getline x < extout) > 0) {
+ numrec++
+ if ((split(x, f, "/") == 3) && (f[3] == "u"))
+ num_unknown++
+ }
+ close(extout)
+ if ((numrec > 0) && (num_unknown == numrec)) {
+ print "Notice: this filesystem does not appear to support file type information" > "/dev/stderr"
+ ftype_unknown = 1
+ }
+}
+
+{
+ ino = $1
+ name = $NF
+ type = substr($2, 1, 1)
+ if (type == "-")
+ type = "f"
+
+ printf "%s/%s/%s\n", ino, name, (ftype_unknown ? "u" : type)
+}