shithub: riscv

Download patch

ref: 2c0ccff2864549e77e1fa3e27802eee429ff3886
parent: 0f1b442bc04c64dcc0709a6a060a0ed3ef4935e7
author: BurnZeZ <devnull@localhost>
date: Mon Jan 27 20:27:41 EST 2020

walk: add D and T fmt characters (fileserver device/type)

--- a/sys/man/1/walk
+++ b/sys/man/1/walk
@@ -89,6 +89,12 @@
 .TP
 .B x
 permissions
+.TP
+.B D
+server device
+.TP
+.B T
+server type (kernel device rune)
 .PD
 .PP
 The default statfmt is simply,
--- a/sys/src/cmd/walk.c
+++ b/sys/src/cmd/walk.c
@@ -71,6 +71,10 @@
 		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 @@
 		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;