From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Sat, 5 Apr 2008 08:53:18 -0500 From: "Caerwyn Jones" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@9fans.net>, inferno-list@vitanuova.com In-Reply-To: <7329CF22-ED80-4935-A7C5-3CBAC472A801@telus.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <13426df10803302208r5e21f6bi77fccf4bc998b221@mail.gmail.com> <32d987d50803311543v48108999g2781e99a5fb1a733@mail.gmail.com> <13426df10803311602i10747188g5f8c14686d37e87b@mail.gmail.com> <7329CF22-ED80-4935-A7C5-3CBAC472A801@telus.net> Subject: Re: [9fans] silliness in flight: build a desktop calculator with srv and rio Topicbox-Message-UUID: 88dc08c0-ead3-11e9-9d60-3106f5b1d025 > > > % dc <[0=1] | echo 0 > /srv/desk > Ok, so this is really neat. How do I do it in inferno? What's the > equivalent of /srv? Inferno has srv(3) which is the file2chan registry. The closest I can get to the above, without writing a new limbo command, is % load file2chan % calc >[0=1] | {file2chan /chan/desk {rblock; putrdata &} {fetchwdata > /fd/0} } & % stream -b 1 /chan/desk % echo 1+1 > /chan/desk It doesn't really work as the plan9 one liner because file2chan is binding a new instance of '#s' each time, so the /chan/desk file isn't visible from other namespaces. If it used an existing instance it would be. Also, putrdata might do multiple reads to satisfy the single read from /chan/desk, which is why I'm using stream -b1 to read. So, not a success, unless anyone can point out a way I missed. Caerwyn