* [9fans] replica @ 2006-08-25 2:30 Richard Bilson 2006-08-25 3:38 ` Lyndon Nerenberg 2006-08-25 14:22 ` [9fans] Pegasus 2.2 is released arisawa 0 siblings, 2 replies; 29+ messages in thread From: Richard Bilson @ 2006-08-25 2:30 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs I attempted to update my system using replica tonight, using glenda's pull script, but as bootes and from the file server console. What seems to have happened is that replica believed that every file ought to be deleted. I stopped it before it made it out of /sys/src, so my system is still usable. Questions: - Why? - What can I do to avoid this in future? - Is there an easy way to get the files resynchronized with sources? If I try "replica/pull -v /dist/replica/network", it tells me sys/src/9/ip/devip.c: not replicated; will not update sys/src/9/pc/etherigbe.c: not replicated; will not update sys/src/9/pc/fns.h: not replicated; will not update etc. I just realized that I didn't have a writable /tmp, so the pull would have failed anyway, but I usually expect an error message in this case, not devastation. - Richard ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [9fans] replica 2006-08-25 2:30 [9fans] replica Richard Bilson @ 2006-08-25 3:38 ` Lyndon Nerenberg 2006-08-25 4:08 ` geoff 2006-08-25 14:22 ` [9fans] Pegasus 2.2 is released arisawa 1 sibling, 1 reply; 29+ messages in thread From: Lyndon Nerenberg @ 2006-08-25 3:38 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs > - What can I do to avoid this in future? Don't Panic! It's not just you -- I saw the same thing when I ran pull this afternoon. It kind of looks like Russ pushed some changes that had the side effect of touching a whole lot of stuff. Or maybe was intentional -- I had to leave before it was done, but my that point it was already putting stuff back. I'll try to drawterm into the server in a little while and see how it's doing. ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [9fans] replica 2006-08-25 3:38 ` Lyndon Nerenberg @ 2006-08-25 4:08 ` geoff 2006-08-25 8:19 ` Martin Neubauer 0 siblings, 1 reply; 29+ messages in thread From: geoff @ 2006-08-25 4:08 UTC (permalink / raw) To: 9fans Our main file server, edith, developed bad spots in its /n/other partition, so we took /n/other out of service until we sort it out. Unfortunately, a lot of the machinery that maintains sources lives there. We'll be working on this problem on Friday. ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [9fans] replica 2006-08-25 4:08 ` geoff @ 2006-08-25 8:19 ` Martin Neubauer 2006-08-27 23:23 ` geoff 0 siblings, 1 reply; 29+ messages in thread From: Martin Neubauer @ 2006-08-25 8:19 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs * geoff@plan9.bell-labs.com (geoff@plan9.bell-labs.com) wrote: > Our main file server, edith, developed bad spots in its /n/other > partition, so we took /n/other out of service until we sort it out. > Unfortunately, a lot of the machinery that maintains sources lives > there. We'll be working on this problem on Friday. No sweat. I ran a pull last night, too, and all the current situation means is that everything gets thrown away and pulled afresh afterwards. Not for the faint of heart though. ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [9fans] replica 2006-08-25 8:19 ` Martin Neubauer @ 2006-08-27 23:23 ` geoff 2006-08-28 2:46 ` Richard Bilson 0 siblings, 1 reply; 29+ messages in thread From: geoff @ 2006-08-27 23:23 UTC (permalink / raw) To: 9fans jmk recovered edith's /n/other onto a new disk on Friday. The old disk had developed bad spots and trying to read it wedged edith, repeatedly and with no messages. With some guidance from Russ, I've restored /n/sourcesdump/2006/0824/plan9/dist/replica/plan9.^(db log) on sources. pull -n at collyer.net seems to be sane again, so I hope it will be for everyone else. ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [9fans] replica 2006-08-27 23:23 ` geoff @ 2006-08-28 2:46 ` Richard Bilson 0 siblings, 0 replies; 29+ messages in thread From: Richard Bilson @ 2006-08-28 2:46 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs > With some guidance from Russ, I've restored > /n/sourcesdump/2006/0824/plan9/dist/replica/plan9.^(db log) on > sources. pull -n at collyer.net seems to be sane again, so I hope it > will be for everyone else. Works for me too. Thanks very much for getting this working again. - Richard ^ permalink raw reply [flat|nested] 29+ messages in thread
* [9fans] Pegasus 2.2 is released 2006-08-25 2:30 [9fans] replica Richard Bilson 2006-08-25 3:38 ` Lyndon Nerenberg @ 2006-08-25 14:22 ` arisawa 2006-08-26 1:56 ` Skip Tavakkolian 2006-08-26 19:29 ` Skip Tavakkolian 1 sibling, 2 replies; 29+ messages in thread From: arisawa @ 2006-08-25 14:22 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs Hello, Pegasus 2.2 is released. New supports are digest authentication, CGI/1.1, etc. and some CGI tools are added. Take a look at http://plan9.aichi-u.ac.jp/pegasus/eman-2.2/ The source files are http://plan9.aichi-u.ac.jp/netlib/pegasus-2.2.tgz Bug report to me. Please enjoy! Kenji Arisawa Email: arisawa@aichi-u.ac.jp ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [9fans] Pegasus 2.2 is released 2006-08-25 14:22 ` [9fans] Pegasus 2.2 is released arisawa @ 2006-08-26 1:56 ` Skip Tavakkolian 2006-08-26 4:36 ` arisawa 2006-08-26 19:29 ` Skip Tavakkolian 1 sibling, 1 reply; 29+ messages in thread From: Skip Tavakkolian @ 2006-08-26 1:56 UTC (permalink / raw) To: 9fans > Pegasus 2.2 is released. > New supports are digest authentication, CGI/1.1, etc. > and some CGI tools are added. this is great. rit is cool. i'm wondering now that js is available in plan9, if it could be integrated into a cgi environment? it seems that rit could easily run different types of script handlers and invoke them like <!--js ... --> or <!--rc --> since that's a natural syntax for html. would it be difficult to integrate this digest authentication into standard httpd? ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [9fans] Pegasus 2.2 is released 2006-08-26 1:56 ` Skip Tavakkolian @ 2006-08-26 4:36 ` arisawa 2006-08-30 1:32 ` Lyndon Nerenberg 0 siblings, 1 reply; 29+ messages in thread From: arisawa @ 2006-08-26 4:36 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs Hello, > it seems > that rit could easily run different types of script handlers and > invoke > them like <!--js ... --> or <!--rc --> since that's a natural > syntax for html. I also considered that, and finally stopped to do so. That makes things complicated and makes coding difficult. If we want other scripting tool, we can do it as a command of "rc". I love "rc". "rc" is best for me. Of course js can be embedded in text part of rc as follows: some text <!--js ... -> other text ${ # rc codes follow .. .....} text continues > would it be difficult to integrate this digest authentication into > standard httpd? Implementing digest authentication is not difficult. However, if we want to change owner of running httpd by digest authentication, then we should consider many many problems. Thanks Skip for your comments. Kenji Arisawa ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [9fans] Pegasus 2.2 is released 2006-08-26 4:36 ` arisawa @ 2006-08-30 1:32 ` Lyndon Nerenberg 0 siblings, 0 replies; 29+ messages in thread From: Lyndon Nerenberg @ 2006-08-30 1:32 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs > Implementing digest authentication is not difficult. > However, if we want to change owner of running httpd by digest > authentication, > then we should consider many many problems. Digest is a bit of a hybrid in that it does authentication, and also provides data integrity and protection. It would be nice to implement the transport layer part in a manner analogous to TLS. I'm currently hacking on Plan 9's IMAP support, and SASL DIGEST with encryption is high on the TODO list. (It's a toss-up as to whether DIGEST-MD5 or STARTTLS has the wider deployment, but software that supports one tends not to support the other, so it's useful to have both for interoperability's sake.) --lyndon ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [9fans] Pegasus 2.2 is released 2006-08-25 14:22 ` [9fans] Pegasus 2.2 is released arisawa 2006-08-26 1:56 ` Skip Tavakkolian @ 2006-08-26 19:29 ` Skip Tavakkolian 2006-08-26 21:51 ` arisawa 1 sibling, 1 reply; 29+ messages in thread From: Skip Tavakkolian @ 2006-08-26 19:29 UTC (permalink / raw) To: 9fans > The source files are http://plan9.aichi-u.ac.jp/netlib/pegasus-2.2.tgz is rit packaged separately? ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [9fans] Pegasus 2.2 is released 2006-08-26 19:29 ` Skip Tavakkolian @ 2006-08-26 21:51 ` arisawa 2006-08-29 4:10 ` [9fans] " Dave Eckhardt 0 siblings, 1 reply; 29+ messages in thread From: arisawa @ 2006-08-26 21:51 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs > is rit packaged separately? > Yes, look http://plan9.aichi-u.ac.jp/netlib/ Kenji Arisawa ^ permalink raw reply [flat|nested] 29+ messages in thread
* [9fans] Re: Pegasus 2.2 is released 2006-08-26 21:51 ` arisawa @ 2006-08-29 4:10 ` Dave Eckhardt 2006-08-29 8:16 ` arisawa 0 siblings, 1 reply; 29+ messages in thread From: Dave Eckhardt @ 2006-08-29 4:10 UTC (permalink / raw) To: 9fans My apologies for the broadcast, but my mail to Kenji Arisawa timed out after failing for 3 days as follows: ----- Transcript of session follows ----- ... while talking to ar.aichi-u.ac.jp.: >>> DATA <<< 450 deferred: smtp ping: smtp: dns: dns failure (/net/tcp!lunacy.ugrad.cs.cmu.edu) <arisawa@ar.aichi-u.ac.jp>... Deferred: 450 deferred: smtp ping: smtp: dns: dns failure (/net/tcp!lunacy.ugrad.cs .cmu.edu) If it looks as if this is due to something on this end, please let me know... Dave Eckhardt ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [9fans] Re: Pegasus 2.2 is released 2006-08-29 4:10 ` [9fans] " Dave Eckhardt @ 2006-08-29 8:16 ` arisawa 2006-08-29 19:57 ` erik quanstrom 0 siblings, 1 reply; 29+ messages in thread From: arisawa @ 2006-08-29 8:16 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs Hello Dave, It seems my machine "ar.aichi-u.ac.jp" dislikes your machine "lunacy.ugrad.cs.cmu.edu", although your machine is observed by the command ndb/dnsdebug on my machine. I don't know the reason. Sorry... Please send your mail to my official mail address: arisawa@aichi-u.ac.jp Kenji Arisawa ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [9fans] Re: Pegasus 2.2 is released 2006-08-29 8:16 ` arisawa @ 2006-08-29 19:57 ` erik quanstrom 2006-08-30 5:39 ` Dave Eckhardt 0 siblings, 1 reply; 29+ messages in thread From: erik quanstrom @ 2006-08-29 19:57 UTC (permalink / raw) To: 9fans cmu.edu is returning bogus results. dig from linux returns "connection reset" on tcp and a truncated query on udp. ndb/dnsquery has better results, but for returns only this for a "cmu.edu any" query ; ndb/dnsquery > cmu.edu any cmu.edu txt [NRDR16452_IN_MX_10.CMU-MX1.ANDREW.CMU.EDU.wRx2sgedR34KMLeiHlkHpA] > cmu.edu ip cmu.edu ip 128.2.10.162 cmu.edu ip 128.2.10.163 - erik ^ permalink raw reply [flat|nested] 29+ messages in thread
* [9fans] Re: Pegasus 2.2 is released 2006-08-29 19:57 ` erik quanstrom @ 2006-08-30 5:39 ` Dave Eckhardt 2006-08-30 23:59 ` erik quanstrom 0 siblings, 1 reply; 29+ messages in thread From: Dave Eckhardt @ 2006-08-30 5:39 UTC (permalink / raw) To: 9fans > cmu.edu is returning bogus results. dig from linux returns "connection > reset" on tcp and a truncated query on udp. Weird--not for me (off campus and not particularly short-haul). What I see with dig, straight at the 3 CMU.EDU servers, is a response truncated due to "excessive" size (e.g., 779 bytes) and apparently-ok responses via TCP. That is: dig +tcp @t-ns2-sec.net.cmu.edu any cmu.edu dig +tcp @cabbage.srv.cs.cmu.edu any cmu.edu dig +tcp @t-ns1.net.cmu.edu any cmu.edu If I ask my LinkSys, what I get back is 102 bytes--lots of stuff trimmed out, apparently by speakeasy.net DNS servers. Are the queries failing for you being made directly, or is there maybe some issue involving an intermediate DNS server? Thanks for letting me know something odd is going on... Dave Eckhardt ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [9fans] Re: Pegasus 2.2 is released 2006-08-30 5:39 ` Dave Eckhardt @ 2006-08-30 23:59 ` erik quanstrom 2006-08-31 8:11 ` [9fans] i need someone to pinpoint a sample program for me : ) bituman 0 siblings, 1 reply; 29+ messages in thread From: erik quanstrom @ 2006-08-30 23:59 UTC (permalink / raw) To: 9fans i was using the Level3-provided dns servers (speakeasy dialup). it all seems better today. - erik ^ permalink raw reply [flat|nested] 29+ messages in thread
* [9fans] i need someone to pinpoint a sample program for me : ) 2006-08-30 23:59 ` erik quanstrom @ 2006-08-31 8:11 ` bituman 2006-08-31 10:18 ` Gabriel Diaz ` (2 more replies) 0 siblings, 3 replies; 29+ messages in thread From: bituman @ 2006-08-31 8:11 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs Ahoi all... Ive been using my plan9 installation for a while. Now i feel comfortable enough to start some coding. Im like lets starts something basic (basic might be a relative term), like a server that exports a ctl and a data file, every line written to ctl can be read from data with the letters sorted. Id like someone to pinpoint a sample program for me that exports files, the most basic such program will do the trick i guess. Thanks in advance bituman ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [9fans] i need someone to pinpoint a sample program for me : ) 2006-08-31 8:11 ` [9fans] i need someone to pinpoint a sample program for me : ) bituman @ 2006-08-31 10:18 ` Gabriel Diaz 2006-08-31 12:52 ` rog 2006-08-31 15:30 ` David Leimbach 2006-08-31 15:05 ` Sergey Zhilkin 2006-09-05 20:25 ` Sascha Retzki 2 siblings, 2 replies; 29+ messages in thread From: Gabriel Diaz @ 2006-08-31 10:18 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs Hello a great sample is /sys/src/lib9p/ramfs.c gabi On 8/31/06, bituman <bituman@enerla.net> wrote: > Ahoi all... > Ive been using my plan9 installation for a while. Now i feel comfortable > enough to start some coding. > Im like lets starts something basic (basic might be a relative term), > like a server that exports a ctl and a data file, > every line written to ctl can be read from data with the letters sorted. > Id like someone to pinpoint a sample program for me that exports files, > the most basic such program will do the trick i guess. > Thanks in advance > bituman > ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [9fans] i need someone to pinpoint a sample program for me : ) 2006-08-31 10:18 ` Gabriel Diaz @ 2006-08-31 12:52 ` rog 2006-08-31 13:38 ` Gabriel Diaz 2006-08-31 15:30 ` David Leimbach 1 sibling, 1 reply; 29+ messages in thread From: rog @ 2006-08-31 12:52 UTC (permalink / raw) To: 9fans > a great sample is /sys/src/lib9p/ramfs.c actually, i don't find this a particularly good example, because it implements an arbitrarily structured namespace, whereas most simpler fileservers serve a static or highly structured namespace. 9p(2) can remove some of the drudgework. ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [9fans] i need someone to pinpoint a sample program for me : ) 2006-08-31 12:52 ` rog @ 2006-08-31 13:38 ` Gabriel Diaz 2006-08-31 13:52 ` Russ Cox 2006-08-31 14:05 ` rog 0 siblings, 2 replies; 29+ messages in thread From: Gabriel Diaz @ 2006-08-31 13:38 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs Hello, I put the sample thinking more on 9p than in ramfs particulary. With that ramfs.c, 9p(2) and 9pfile(2) is "easy" to build what he wants. At least i found it easier than reading nntpfs.c and the other samples that do not use 9p and have a syntetic fs. I think this has been discused in 9fans time ago, but didn't remember what the conclusion was (producing more samples :-? ) nemo's book looks promising, i will read it to learn some things too. I hope that the "magic" around the qids,fids and refs get explained. gabi On 8/31/06, rog@vitanuova.com <rog@vitanuova.com> wrote: > > a great sample is /sys/src/lib9p/ramfs.c > > actually, i don't find this a particularly good example, because it implements > an arbitrarily structured namespace, whereas most simpler fileservers serve > a static or highly structured namespace. > > 9p(2) can remove some of the drudgework. > ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [9fans] i need someone to pinpoint a sample program for me : ) 2006-08-31 13:38 ` Gabriel Diaz @ 2006-08-31 13:52 ` Russ Cox 2006-08-31 14:04 ` rog 2006-08-31 14:05 ` rog 1 sibling, 1 reply; 29+ messages in thread From: Russ Cox @ 2006-08-31 13:52 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs > nemo's book looks promising, i will read it to learn some things too. > I hope that the "magic" around the qids,fids and refs get explained. after reading intro(5) there should be no magic around qids and fids anymore. and ref is just a reference count. russ ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [9fans] i need someone to pinpoint a sample program for me : ) 2006-08-31 13:52 ` Russ Cox @ 2006-08-31 14:04 ` rog 2006-09-07 23:54 ` Russ Cox 0 siblings, 1 reply; 29+ messages in thread From: rog @ 2006-08-31 14:04 UTC (permalink / raw) To: 9fans > after reading intro(5) there should be no magic around qids and fids anymore. > and ref is just a reference count. i have thought in the past that the man pages could make it clearer how ref counts interact with clunk - i.e. that a client will never send a clunk while there are outstanding transactions on the fid. this (i think) falls naturally from the way things are implemented in plan 9, but might not be obvious to those writing servers (or new clients). ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [9fans] i need someone to pinpoint a sample program for me : ) 2006-08-31 14:04 ` rog @ 2006-09-07 23:54 ` Russ Cox 0 siblings, 0 replies; 29+ messages in thread From: Russ Cox @ 2006-09-07 23:54 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs > i have thought in the past that the man pages could make it > clearer how ref counts interact with clunk - i.e. that a client will never > send a clunk while there are outstanding transactions on the fid. > this (i think) falls naturally from the way things are implemented > in plan 9, but might not be obvious to those writing servers (or > new clients). i don't actually know how ref counts interact with clunk. certainly the plan 9 kernels don't send clunks of fids with transactions outstanding, but there is nothing in section 5 that says this is a requirement, and even if there were, robust servers would do well to detect that case anyway. much of the ref counting in lib9p exists for exactly this purpose, to do something sensible even when the client doesn't. russ ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [9fans] i need someone to pinpoint a sample program for me : ) 2006-08-31 13:38 ` Gabriel Diaz 2006-08-31 13:52 ` Russ Cox @ 2006-08-31 14:05 ` rog 1 sibling, 0 replies; 29+ messages in thread From: rog @ 2006-08-31 14:05 UTC (permalink / raw) To: 9fans > I put the sample thinking more on 9p than in ramfs particulary. ... and i'm sorry because i didn't read the source path name properly. i'd forgotten there was a ramfs example in lib9p, and was thinking you'd pointed to /sys/src/cmd/ramfs.c which is a different beast entirely (and has been recommended as an example in the past). i'd agree that /sys/src/lib9p/ramfs.c is a useful example. ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Re: [9fans] i need someone to pinpoint a sample program for me : ) 2006-08-31 10:18 ` Gabriel Diaz 2006-08-31 12:52 ` rog @ 2006-08-31 15:30 ` David Leimbach 2006-08-31 15:32 ` David Leimbach 1 sibling, 1 reply; 29+ messages in thread From: David Leimbach @ 2006-08-31 15:30 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs On 8/31/06, Gabriel Diaz <gabidiaz@gmail.com> wrote: > Hello > > a great sample is /sys/src/lib9p/ramfs.c > I disagree, I tried to learn from that and the code seems to make some shortcuts around certain issues. It also seems to label itself as a "toy" in the comments. It works well enough for how I'm using it though :-) > gabi > > > On 8/31/06, bituman <bituman@enerla.net> wrote: > > Ahoi all... > > Ive been using my plan9 installation for a while. Now i feel comfortable > > enough to start some coding. > > Im like lets starts something basic (basic might be a relative term), > > like a server that exports a ctl and a data file, > > every line written to ctl can be read from data with the letters sorted. > > Id like someone to pinpoint a sample program for me that exports files, > > the most basic such program will do the trick i guess. > > Thanks in advance > > bituman > > > ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: Re: Re: [9fans] i need someone to pinpoint a sample program for me : ) 2006-08-31 15:30 ` David Leimbach @ 2006-08-31 15:32 ` David Leimbach 0 siblings, 0 replies; 29+ messages in thread From: David Leimbach @ 2006-08-31 15:32 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs On 8/31/06, David Leimbach <leimy2k@gmail.com> wrote: > On 8/31/06, Gabriel Diaz <gabidiaz@gmail.com> wrote: > > Hello > > > > a great sample is /sys/src/lib9p/ramfs.c > > > I disagree, I tried to learn from that and the code seems to make some > shortcuts around certain issues. It also seems to label itself as a > "toy" in the comments. > > It works well enough for how I'm using it though :-) Heh, looks like I made the same mistake as rog.... D'oh! > > > gabi > > > > > > On 8/31/06, bituman <bituman@enerla.net> wrote: > > > Ahoi all... > > > Ive been using my plan9 installation for a while. Now i feel comfortable > > > enough to start some coding. > > > Im like lets starts something basic (basic might be a relative term), > > > like a server that exports a ctl and a data file, > > > every line written to ctl can be read from data with the letters sorted. > > > Id like someone to pinpoint a sample program for me that exports files, > > > the most basic such program will do the trick i guess. > > > Thanks in advance > > > bituman > > > > > > ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [9fans] i need someone to pinpoint a sample program for me : ) 2006-08-31 8:11 ` [9fans] i need someone to pinpoint a sample program for me : ) bituman 2006-08-31 10:18 ` Gabriel Diaz @ 2006-08-31 15:05 ` Sergey Zhilkin 2006-09-05 20:25 ` Sascha Retzki 2 siblings, 0 replies; 29+ messages in thread From: Sergey Zhilkin @ 2006-08-31 15:05 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs [-- Attachment #1: Type: text/plain, Size: 661 bytes --] Hi !!! Here is a sample - http://rs-rlab.narod.ru/dev9b.html Documentation in russian (sorry) Have a nice day ! :) 2006/8/31, bituman <bituman@enerla.net>: > > Ahoi all... > Ive been using my plan9 installation for a while. Now i feel comfortable > enough to start some coding. > Im like lets starts something basic (basic might be a relative term), > like a server that exports a ctl and a data file, > every line written to ctl can be read from data with the letters sorted. > Id like someone to pinpoint a sample program for me that exports files, > the most basic such program will do the trick i guess. > Thanks in advance > bituman > [-- Attachment #2: Type: text/html, Size: 968 bytes --] ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [9fans] i need someone to pinpoint a sample program for me : ) 2006-08-31 8:11 ` [9fans] i need someone to pinpoint a sample program for me : ) bituman 2006-08-31 10:18 ` Gabriel Diaz 2006-08-31 15:05 ` Sergey Zhilkin @ 2006-09-05 20:25 ` Sascha Retzki 2 siblings, 0 replies; 29+ messages in thread From: Sascha Retzki @ 2006-09-05 20:25 UTC (permalink / raw) To: 9fans > Ahoi all... > Im like lets starts something basic (basic might be a relative term), > like a server that exports a ctl and a data file, > every line written to ctl can be read from data with the letters sorted. I did something like this some long time ago, I was told that using 9p(2)/9pfile(2) for such tiny things, which file structure does not change much is not suggested - I actually did not get that. Anyway, this may not even compile, I copied out of a source-tree. You want to read it and understand every line, anyway, do you? ;) #include <u.h> #include <libc.h> #include <fcall.h> #include <thread.h> #include <9p.h> Srv *daefs; /* our file layout. Note that the enum Qstatus is used in daefsfiles_create() to determine the size of the array. Either fix the function or add files (in any) before Qstatus. */ enum { Qctl, Qout, Qstatus, }; struct { char name[20]; /* name of the file */ ulong mode; /* permission mode */ File *file; /* File-struct used by createfile() */ char *data; /* The data this file contains */ } daefsfiles[] = { "ctl", 0666, nil, nil, "output", 0444, nil, nil, "status", 0444, nil, nil, }; void daefs_write(Req *r) { int i, myQid = (int)r->fid->file->qid.path; if(myQid > Qstatus) sysfatal("unknown Qid %d in write-call\n",myQid); for(i=0;i+r->ifcall.offset < FILESIZE && i < r->ifcall.count;i++) { daefsfiles[myQid].data[i+r->ifcall.offset] = r->ifcall.data[i]; r->ofcall.count++; } daefsfiles[myQid].file->length = r->ifcall.offset + r->ifcall.count; if(myQid == Qctl) { char *msg = daefsfiles[Qctl].data; // Do your processing... // Copy the string strcpy(daefsfiles[Qstatus].data,msg); // Do not forget to set the new length of the file, for stat(5) etc. daefsfiles[Qstatus].file->length = strlen(msg); } respond(r,nil); } void daefs_read(Req *r) { readstr(r,daefsfiles[(int)r->fid->file->qid.path].data); respond(r,nil); } void daefsfiles_create(void) { int i; if((daefs->tree = alloctree("daefs","daefs",DMDIR|0777,nil)) == nil) sysfatal("daefs: daefsfiles_create(): alloctree() == nil"); for(i=0;i<=Qstatus;i++) { daefsfiles[i].data = emalloc9p(FILESIZE); if((daefsfiles[i].file = createfile(daefs->tree->root, daefsfiles[i].name,"daefs", daefsfiles[i].mode,(void *)daefsfiles[i].data)) == nil) sysfatal("daefs: daefsfiles_create() for file \"%s\": createfile() == nil\n",daefsfiles[i].name); } daefs_status("ready\n"); } void main(int argc, char **argv) { char *mtpt = "/n/daefs/"; daefs = emalloc9p(sizeof(Srv)); daefs->write = daefs_write; daefs->read = daefs_read; daefsfiles_create(); threadpostmountsrv(daefs,"daefs",mtpt,0); } ^ permalink raw reply [flat|nested] 29+ messages in thread
end of thread, other threads:[~2006-09-07 23:54 UTC | newest] Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2006-08-25 2:30 [9fans] replica Richard Bilson 2006-08-25 3:38 ` Lyndon Nerenberg 2006-08-25 4:08 ` geoff 2006-08-25 8:19 ` Martin Neubauer 2006-08-27 23:23 ` geoff 2006-08-28 2:46 ` Richard Bilson 2006-08-25 14:22 ` [9fans] Pegasus 2.2 is released arisawa 2006-08-26 1:56 ` Skip Tavakkolian 2006-08-26 4:36 ` arisawa 2006-08-30 1:32 ` Lyndon Nerenberg 2006-08-26 19:29 ` Skip Tavakkolian 2006-08-26 21:51 ` arisawa 2006-08-29 4:10 ` [9fans] " Dave Eckhardt 2006-08-29 8:16 ` arisawa 2006-08-29 19:57 ` erik quanstrom 2006-08-30 5:39 ` Dave Eckhardt 2006-08-30 23:59 ` erik quanstrom 2006-08-31 8:11 ` [9fans] i need someone to pinpoint a sample program for me : ) bituman 2006-08-31 10:18 ` Gabriel Diaz 2006-08-31 12:52 ` rog 2006-08-31 13:38 ` Gabriel Diaz 2006-08-31 13:52 ` Russ Cox 2006-08-31 14:04 ` rog 2006-09-07 23:54 ` Russ Cox 2006-08-31 14:05 ` rog 2006-08-31 15:30 ` David Leimbach 2006-08-31 15:32 ` David Leimbach 2006-08-31 15:05 ` Sergey Zhilkin 2006-09-05 20:25 ` Sascha Retzki
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).