aboutsummaryrefslogtreecommitdiffstats
path: root/test/readdir0.awk
blob: c98ac674dcef70c05ae430d7e66248b65858ee52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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)
}