From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 2159 invoked from network); 4 Apr 2021 19:36:15 -0000 Received: from 1ess.inri.net (216.126.196.35) by inbox.vuxu.org with ESMTPUTF8; 4 Apr 2021 19:36:15 -0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by 1ess; Sat Apr 3 20:34:48 -0400 2021 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id A5BAA5C0050 for <9front@9front.org>; Sat, 3 Apr 2021 20:34:46 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sat, 03 Apr 2021 20:34:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sgregoratto.me; h=date:from:to:subject:message-id:mime-version:content-type; s= fm2; bh=S7ImV5ByjquJ9RRa1WByX6htCBy6zwJ4SZ9AmrtM9Wk=; b=mVDhASVg ap8/GcZT3IJWlgy+ORxD+P7T+g0uTCetOaqIY7hVf6jRkY3j20heYlnY2ihnLhQ2 IsmDh63aoWPLIdelCeXygNhPBo9X7Bpz1T4k3HvZc/y0alr+3Ulv7CxLUHBt7jKk QyEnmKws3uMUPyJ66j5qJ24mL9G+Zjb9mafy+VxCkB0m0VDl8ivehCYL5W12Fvr1 ZV+j/EJdJzFWRaFXbJKF5PIAcr5A5Q6uZ7cPlEIbHeGKSkIuxxW9HpNDWOwcPo71 nvHBuha9El9gvoyoCde51p5iFusfDjCxWTWS9ZmxEbbUtge63+tVBL16HAHarliZ l2RjTSxu/RUKVg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=S7ImV5ByjquJ9RRa1WByX6htCBy6z wJ4SZ9AmrtM9Wk=; b=IvxLFEVgPCE4hVqBcCiZdpOZSfASDbaIR+4XTt7wmrIkU eSSK7ivR46CYS6diMb+Um8tglOtmOm06vB69xhW1C7YJsUPp9I+W/JOt3TN4zFO8 Ll7b9G/M81PZiuHQ7YIbpimgNJ2hVYCVo//00Ay2/g9pTr1TTTHLhaIBi3e+QmvG jREm2s4dQeNpjLQFMUWy9bjwxqT+kD22287uVuJJKrSNXnwhSWMxh8fTMQ9Qt+Hb NXOGzEKj+I1d3G6ouOlyc3K9eyevbKAT+JrJ29JZY4VdJkd+aLfNkpIma5iY1kUo LtMAqPYseGF13HUWEwTxul0mYTq8D/FmR6RC//qXg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudeiledgfeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkgggtugesthdtredttd dtjeenucfhrhhomhepufhtvghphhgvnhcuifhrvghgohhrrghtthhouceouggvvhesshhg rhgvghhorhgrthhtohdrmhgvqeenucggtffrrghtthgvrhhnpedugefhkefhfeekleffie efgfdvffetiedvueekffejfeefueduhfekleffjeeiieenucfkphepheekrddujeelrdeg gedrudejvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpeguvghvsehsghhrvghgohhrrghtthhordhmvg X-ME-Proxy: Received: from localhost (58-179-44-172.sta.dodo.net.au [58.179.44.172]) by mail.messagingengine.com (Postfix) with ESMTPA id 03EB81080054 for <9front@9front.org>; Sat, 3 Apr 2021 20:34:45 -0400 (EDT) Date: Sun, 4 Apr 2021 10:34:41 +1000 From: Stephen Gregoratto To: 9front@9front.org Message-ID: <20210404003441.lutl2xy7avmlduga@BlackBox> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: ISO-certified strategy SSL over HTTP cloud injection-aware pipelining generator Subject: [9front] walk: properly format permissions Reply-To: 9front@9front.org Precedence: bulk This patch adds dirmodefmt from fcall.h to pretty-print file permissions, similarly to ls -l. I didn't notice any performance degradation. I hope no-one relied on the old behaviour. diff -r 4dfbef4fa4ac sys/man/1/walk --- a/sys/man/1/walk Sat Apr 03 19:32:47 2021 +0200 +++ b/sys/man/1/walk Sun Apr 04 10:25:44 2021 +1000 @@ -123,8 +123,6 @@ .IR ls (1), .IR du (1) .SH BUGS -Statfmt character `x' displays permissions as an integer. -.PP Manipulating ifs is a nuisance. .PP File names are assumed to not contain newlines. diff -r 4dfbef4fa4ac sys/src/cmd/walk.c --- a/sys/src/cmd/walk.c Sat Apr 03 19:32:47 2021 +0200 +++ b/sys/src/cmd/walk.c Sun Apr 04 10:25:44 2021 +1000 @@ -2,6 +2,7 @@ #include #include #include +#include int Cflag = 0; int uflag = 0; @@ -70,7 +71,7 @@ break; 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; + case 'x': Bprint(bout, "%M", 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; @@ -250,6 +251,8 @@ usage(); }ARGEND; + fmtinstall('M', dirmodefmt); + if((bout = Bfdopen(1, OWRITE)) == nil) sysfatal("Bfdopen: %r"); Blethal(bout, nil); -- Stephen Gregoratto