]> git.lizzy.rs Git - plan9front.git/commitdiff
walk: add D and T fmt characters (fileserver device/type)
authorBurnZeZ <devnull@localhost>
Tue, 28 Jan 2020 01:27:41 +0000 (01:27 +0000)
committerBurnZeZ <devnull@localhost>
Tue, 28 Jan 2020 01:27:41 +0000 (01:27 +0000)
sys/man/1/walk
sys/src/cmd/walk.c

index 6129b0a3d328b0df221171827b233f3cdeeb44b4..f8e7a75e22b845066988eb2013939893975e590b 100644 (file)
@@ -89,6 +89,12 @@ size in bytes
 .TP
 .B x
 permissions
+.TP
+.B D
+server device
+.TP
+.B T
+server type (kernel device rune)
 .PD
 .PP
 The default statfmt is simply,
index 12f42e5b15b603e43d07716432c87d0f37a63ce3..cd83acca74bbaaa6505c69d7757c09fdd8ba635c 100644 (file)
@@ -71,6 +71,10 @@ dofile(char *path, Dir *f, int pathonly)
                case 'q': Bprint(bout, "%ullx.%uld.%.2uhhx", f->qid.path, f->qid.vers, f->qid.type); break;
                case 's': Bprint(bout, "%lld", f->length); break;
                case 'x': Bprint(bout, "%ulo", f->mode); break;
+
+               /* These two  are slightly different, as they tell us about the fileserver instead of the file */
+               case 'D': Bprint(bout, "%ud", f->dev); break;
+               case 'T': Bprint(bout, "%C", f->type); break;
                default:
                        abort();
                }
@@ -238,7 +242,7 @@ main(int argc, char **argv)
                if((stfmt = s_reset(stfmt)) == nil)
                        sysfatal("s_reset: %r");
                s_append(stfmt, EARGF(usage()));
-               i = strspn(s_to_c(stfmt), "UGMamnpqsx");
+               i = strspn(s_to_c(stfmt), "UGMamnpqsxDT");
                if(i != s_len(stfmt))
                        sysfatal("bad stfmt: %s", s_to_c(stfmt));
                break;