9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Enrico Weigelt <weigelt@metux.de>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] 9P writes for directories
Date: Sun, 19 Apr 2009 18:43:45 +0200	[thread overview]
Message-ID: <20090419164345.GC4722@nibiru.local> (raw)
In-Reply-To: <5d375e920903271836u674ea674x52dbe10e0491a8d8@mail.gmail.com>

* Uriel <uriel99@gmail.com> wrote:

Hi folks,

<snip>

I've completely followed the whole thread, but just a few ideas
how it could look like:

Essentially we need the operations:

    #1: read from some file, ev. w/ some offset and a limit
    #2: write to some file, ev. w/ some offset
    #3: create a new file
    #4: remove some file
    #5: list directories

Okay, lets make a start:

#1: reading

>> GET /some/file HTTP/1.1
>> Offset: 512
>> Limit: 4096
>>
--
<< 300 OK
<< Content-Length: 433
<<
<< dajlfajelfhaewfhaewfhlfhawlfhalefhailheflaefhalehfalefhalfhawlefhaweflh
...

For synthetic files which dont return data immediately, we could add some
additional Timeout: header. If the timeout is over, the server replies
with some appropriate code, maybe 204 or 206.

#2: writing

>> PUT /some/file HTTP/1.1
>> Offet: 512
>> Content-Size: 1024
>>
>> dfljfldkjldfjadlfjaljfldjfaldjfldjfldjf
...

<< 300 OK
<<

#3: create new file

simple write to an non-existing file

#4: remove some file:

>> REMOVE /some/file HTTP/1.1
>>
...
<< 300 OK
<<

#5: list a directory

just read the resource, the listing will be replied in ls -l format.


Okay, this approach has the drawback, that we don't have the concept
of file descriptors, so working with synthethic filesystems still might
be ugly. To get out of this, we could put the actual files and fd's
in their own namespaces, eg:

/root/ -> contains the actual files
/fd/ -> contains the fd's (counted up)

As we now need some client/connection identification, we could use a
cookie for that. Simply GET / without a cookie, and get back an reply
with a new cookie. Maybe there could even be some special file/subdir
for things like authentication (if its not already done through SSL
or HTTP authentication headers).


cu
--
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 cellphone: +49 174 7066481   email: info@metux.de   skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------



      parent reply	other threads:[~2009-04-19 16:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-21  7:00 Roman Shaposhnik
2009-03-26 19:31 ` Roman Shaposhnik
2009-03-26 19:35   ` erik quanstrom
2009-03-26 19:50     ` Roman Shaposhnik
2009-03-26 19:56       ` erik quanstrom
2009-03-26 19:44   ` Eric Van Hensbergen
2009-03-26 20:23     ` Roman Shaposhnik
2009-03-26 20:52       ` erik quanstrom
2009-03-26 20:54       ` Eric Van Hensbergen
2009-03-26 22:05         ` Roman Shaposhnik
2009-03-28  1:36           ` Uriel
2009-03-28  4:03             ` Roman Shaposhnik
2009-04-19 16:43             ` Enrico Weigelt [this message]

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=20090419164345.GC4722@nibiru.local \
    --to=weigelt@metux.de \
    --cc=9fans@9fans.net \
    /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).