From: beto@plan9.cs.su.oz.au beto@plan9.cs.su.oz.au
Subject: reading selected text in acme
Date: Mon, 9 Oct 1995 19:21:54 -0400 [thread overview]
Message-ID: <19951009232154.fu3q-0kfISN8r2VpBHu94O9kTcTt7h_3UoL8A_Wx230@z> (raw)
In <95Oct9.021146edt.78511@colossus.cse.psu.edu>
rob@plan9.att.com wrote:
> #include <u.h>
> #include <libc.h>
>
> /* assumes chars==characters. fixing this is an exercise for the reader */
>
> void
> main(void)
> {
> int c, a, d, x1, x2;
> char buf[256];
>
> c = open("/mnt/acme/1/ctl", ORDWR);
> a = open("/mnt/acme/1/addr", OREAD);
> d = open("/mnt/acme/1/data", OREAD);
> write(c, "addr=dot", 8);
> read(a, buf, sizeof buf);
> x1 = atoi(buf);
> x2 = atoi(buf+12);
> seek(d, x1, 0);
> read(d, buf, x2-x1);
> write(1, buf, x2-x1);
> exits(0);
> }
>
>
>
Thanks
next reply other threads:[~1995-10-09 23:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-10-09 23:21 beto [this message]
-- strict thread matches above, loose matches on Subject: below --
1995-10-09 17:29 beto
1995-10-09 6:02 rob
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=19951009232154.fu3q-0kfISN8r2VpBHu94O9kTcTt7h_3UoL8A_Wx230@z \
--to=beto@plan9.cs.su.oz.au \
/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).