From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Sun, 19 Apr 2009 18:43:45 +0200 From: Enrico Weigelt To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Message-ID: <20090419164345.GC4722@nibiru.local> References: <3A09771D-9AD3-4499-A354-A3111F5AD0EF@sun.com> <584ACAD1-5343-4656-AEBC-8C0BFDD5724C@sun.com> <822E5D94-A700-4A8F-9B3D-B354AEFF6789@sun.com> <5d375e920903271836u674ea674x52dbe10e0491a8d8@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5d375e920903271836u674ea674x52dbe10e0491a8d8@mail.gmail.com> User-Agent: Mutt/1.4.1i Subject: Re: [9fans] 9P writes for directories Topicbox-Message-UUID: e93a8844-ead4-11e9-9d60-3106f5b1d025 * Uriel wrote: Hi folks, 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 ----------------------------------------------------------------------