9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Using webfs from rc
@ 2014-07-14 12:08 Riddler
  2014-07-14 12:27 ` Ingo Krabbe
  0 siblings, 1 reply; 5+ messages in thread
From: Riddler @ 2014-07-14 12:08 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hey guys,

Been toying with webfs/abaco and I'm attempting to try to use it
(webfs) from rc without much luck.

I've been doing the following:
% cat clone
    0
    acceptcookies on
    sendcookies on
    redirectlimit 10
    useragent webfs/2.0 (plan 9)
% cd 0
% echo -n url http://www.google.co.uk > ctl
% cat body
    cat: can't open body: 'body' url is not yet set

I'm unsure why this doesn't seem to be working. I took a look at the
abaco source and it looks like this is all it does as well when POST
data is not involved.

I've tried various forms of url with trailing slashes and pages I know
result in content but still nothing.

Any idea where I'm going wrong?



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] Using webfs from rc
  2014-07-14 12:08 [9fans] Using webfs from rc Riddler
@ 2014-07-14 12:27 ` Ingo Krabbe
  2014-07-14 15:08   ` Stanley Lieber
  2014-07-14 16:02   ` erik quanstrom
  0 siblings, 2 replies; 5+ messages in thread
From: Ingo Krabbe @ 2014-07-14 12:27 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 626 bytes --]

Hey riddler,

that has something to do with the way how you open the connection.

I'm not 100% sure if its a perfect description what happens, but when you

> % echo -n url http://www.google.co.uk > ctl

the >ctl will open and close the connection to 0/ctl. But you can read the body only while the 0/ctl device is open. (Or it might be differnet that you need to open body for reading before you open and send to ctl).

Best is to check the code of hget to understand how this works.

I'm not sure if it's possible or in any way convenient to use webfs through rc. I think hget is your friend.

cheers

ingo

[-- Attachment #2: Type: message/rfc822, Size: 5254 bytes --]

From: Riddler <riddler876@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: [9fans] Using webfs from rc
Date: Mon, 14 Jul 2014 13:08:49 +0100
Message-ID: <CAGMcHPqbh-mnTYbzP90fLDAERiHW=-iUocfohi8ZS=Xj_Ee+WQ@mail.gmail.com>

Hey guys,

Been toying with webfs/abaco and I'm attempting to try to use it
(webfs) from rc without much luck.

I've been doing the following:
% cat clone
    0
    acceptcookies on
    sendcookies on
    redirectlimit 10
    useragent webfs/2.0 (plan 9)
% cd 0
% echo -n url http://www.google.co.uk > ctl
% cat body
    cat: can't open body: 'body' url is not yet set

I'm unsure why this doesn't seem to be working. I took a look at the
abaco source and it looks like this is all it does as well when POST
data is not involved.

I've tried various forms of url with trailing slashes and pages I know
result in content but still nothing.

Any idea where I'm going wrong?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] Using webfs from rc
  2014-07-14 12:27 ` Ingo Krabbe
@ 2014-07-14 15:08   ` Stanley Lieber
  2014-07-14 16:02   ` erik quanstrom
  1 sibling, 0 replies; 5+ messages in thread
From: Stanley Lieber @ 2014-07-14 15:08 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

The following is hget implemented in rc:

http://code.google.com/p/plan9front/source/browse/rc/bin/hget

sl




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] Using webfs from rc
  2014-07-14 12:27 ` Ingo Krabbe
  2014-07-14 15:08   ` Stanley Lieber
@ 2014-07-14 16:02   ` erik quanstrom
  2014-07-14 16:56     ` Riddler
  1 sibling, 1 reply; 5+ messages in thread
From: erik quanstrom @ 2014-07-14 16:02 UTC (permalink / raw)
  To: 9fans

> that has something to do with the way how you open the connection.
>
> I'm not 100% sure if its a perfect description what happens, but when you
>
> > % echo -n url http://www.google.co.uk > ctl
>
> the >ctl will open and close the connection to 0/ctl. But you can read the body only while the 0/ctl device is open. (Or it might be differnet that you need to open body for reading before you open and send to ctl).
>
> Best is to check the code of hget to understand how this works.
>
> I'm not sure if it's possible or in any way convenient to use webfs through rc. I think hget is your friend.

9p file servers know which "connection" (fid) they're talking to.
echo fu>bar; cat bar creates two unrelated fids.
for a file server that considers each fid a unique transaction,
the user needs to arrange for the same file to be used for the
request and response.

this can be done in rc with the <>{cmd} idiom.  see rc(1).
it can be a little confusing.

- erik



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] Using webfs from rc
  2014-07-14 16:02   ` erik quanstrom
@ 2014-07-14 16:56     ` Riddler
  0 siblings, 0 replies; 5+ messages in thread
From: Riddler @ 2014-07-14 16:56 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

That makes sense, thanks for the info guys!



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-07-14 16:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-14 12:08 [9fans] Using webfs from rc Riddler
2014-07-14 12:27 ` Ingo Krabbe
2014-07-14 15:08   ` Stanley Lieber
2014-07-14 16:02   ` erik quanstrom
2014-07-14 16:56     ` Riddler

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).