From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Sat, 6 Mar 2010 07:13:31 -0800 Message-ID: <3e1162e61003060713s1c9cc2c4i1b5e8d7deb9d335e@mail.gmail.com> From: David Leimbach To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=000e0cd761d863f0fd04812346c1 Subject: Re: [9fans] acme(4) and addr=dot Topicbox-Message-UUID: e15fec3a-ead5-11e9-9d60-3106f5b1d025 --000e0cd761d863f0fd04812346c1 Content-Type: text/plain; charset=ISO-8859-1 I think you want to create some kind of redirected handle to the ctl file first, then start a new block in rc. I believe this is how network programming in rc can be accomplished in Inferno as well. Is this not allowed in p9p? I've honestly not used the 9p commands too often. On Fri, Mar 5, 2010 at 7:37 PM, Micah Stetson wrote: > I think this may apply to all versions of acme, but I'm running into > it on p9p. First, acme(4) claims that a read on a window's addr file > returns the current address as a pair of character offsets m and n, in > '#m,#n' format or just '#m' if m and n are equal. It looks like it > really returns m and n as two space-padded integer values. > > But that's just a documentation bug. What's really bothering me is > that I can't seem to get the value of dot. I've tried this: > > % echo -n 'addr=dot' | 9p write acme/70/ctl > % 9p read acme/70/addr > 0 0 % > > Window 70's dot is somewhere on line 16. Thinking maybe the ctl file > had to stay open, I tried this: > > % {echo 'addr=dot'; 9p read acme/70/addr >[1=2]} | 9p write acme/70/ctl > 0 0 % > > No help. Am I doing something wrong? > > Micah > > --000e0cd761d863f0fd04812346c1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I think you want to create some kind of redirected handle to the ctl file f= irst, then start a new block in rc. =A0I believe this is how network progra= mming in rc can be accomplished in Inferno as well. =A0Is this not allowed = in p9p? =A0I've honestly not used the 9p commands too often.

On Fri, Mar 5, 2010 at 7:37 PM, Micah Stetso= n <micah@stets= onnet.org> wrote:
I think this may apply to all versions of acme, but I'm running into it on p9p. =A0First, acme(4) claims that a read on a window's addr file=
returns the current address as a pair of character offsets m and n, in
'#m,#n' format or just '#m' if m and n are equal. =A0It loo= ks like it
really returns m and n as two space-padded integer values.

But that's just a documentation bug. =A0What's really bothering me = is
that I can't seem to get the value of dot. =A0I've tried this:

% echo -n 'addr=3Ddot' | 9p write acme/70/ctl
% 9p read acme/70/addr
=A0 =A0 =A0 =A0 =A00 =A0 =A0 =A0 =A0 =A0 0 %

Window 70's dot is somewhere on line 16. =A0Thinking maybe the ctl file=
had to stay open, I tried this:

% {echo 'addr=3Ddot'; 9p read acme/70/addr >[1=3D2]} | 9p write = acme/70/ctl
=A0 =A0 =A0 =A0 =A00 =A0 =A0 =A0 =A0 =A0 0 %

No help. =A0Am I doing something wrong?

Micah


--000e0cd761d863f0fd04812346c1--