9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Caerwyn Jones" <caerwynj@gmail.com>
To: "Fans of the OS Plan 9 from Bell Labs" <9fans@9fans.net>,
	inferno-list@vitanuova.com
Subject: Re: [9fans] silliness in flight: build a desktop calculator with srv and rio
Date: Sat,  5 Apr 2008 08:53:18 -0500	[thread overview]
Message-ID: <ff4df6da0804050653o1682bf33n5ab73cbdd64db12f@mail.gmail.com> (raw)
In-Reply-To: <7329CF22-ED80-4935-A7C5-3CBAC472A801@telus.net>

> > >  % 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


  reply	other threads:[~2008-04-05 13:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-31  5:08 ron minnich
2008-03-31 22:43 ` Federico G. Benavento
2008-03-31 22:51   ` Pietro Gagliardi
2008-03-31 22:57     ` andrey mirtchovski
2008-03-31 23:04     ` ron minnich
2008-03-31 23:02   ` ron minnich
2008-04-04 18:05     ` Paul Lalonde
2008-04-05 13:53       ` Caerwyn Jones [this message]
2008-03-31 23:04   ` ron minnich
2008-04-01 11:11   ` [9fans] silliness in flight: build a desktop calculator with kokamoto
2008-04-01 13:11     ` ron minnich
2008-04-01 13:29       ` Eric Van Hensbergen
2008-04-01 14:46         ` ron minnich
2008-04-01 16:10     ` Skip Tavakkolian
2008-04-02 11:19       ` kokamoto
2008-04-01 17:48     ` Federico G. Benavento
2008-04-01 22:08       ` hiro
2008-04-02 11:46       ` kokamoto
2008-04-02 13:20         ` hiro
2008-04-02 22:38         ` Federico G. Benavento

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ff4df6da0804050653o1682bf33n5ab73cbdd64db12f@mail.gmail.com \
    --to=caerwynj@gmail.com \
    --cc=9fans@9fans.net \
    --cc=inferno-list@vitanuova.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).