9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] searchfs
Date: Thu,  6 Aug 2009 09:07:11 -0400	[thread overview]
Message-ID: <ad9190200142500e61e128e444446b9a@quanstro.net> (raw)
In-Reply-To: <B6C8DAB7-AAC6-432E-9005-C8C21D741709@storytotell.org>

On Thu Aug  6 04:50:48 EDT 2009, fusion@storytotell.org wrote:
> I googled around and haven't found anything, but I notice there is a
> file /sys/src/cmd/aux/searchfs.c, and a corresponding binary aux/
> searchfs. The code doesn't seem to explain what it does very well but
> it piqued my curiosity.
>
> What's this do and how is it intended to be used? I don't know exactly
> what it wants for a database; I tried using /lib/words and it didn't
> blow up but I'm not sure that's what it needs. I found the /search
> file will accept strings like 'search=word' but it doesn't seem to
> have an effect in the filesystem, nor does reading from it produce
> anything.
>
> Any pointers on how to use this? Or is it defunct or some kind of dead
> end?

you need to read and write the same file descriptor.  (i'm
not sure why i would use this instead of grep, even for http
queries.)  <>[fd] is rc syntax for opening a file for r/w.
here's an example of opening fd 3 rw, then sending the
query into that fd and reading the results back:

; aux/searchfs -m /n/search /lib/words
; cd /n/search
; <>[3] search {echo -n 'search=eat' >[1=3]; cat <[0=3]}
amphitheater
anteater
[...]

- erik



  reply	other threads:[~2009-08-06 13:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-06  8:49 Daniel Lyons
2009-08-06 13:07 ` erik quanstrom [this message]
2009-08-06 15:28   ` Russ Cox

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=ad9190200142500e61e128e444446b9a@quanstro.net \
    --to=quanstro@quanstro.net \
    --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).