9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] searchfs
@ 2009-08-06  8:49 Daniel Lyons
  2009-08-06 13:07 ` erik quanstrom
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Lyons @ 2009-08-06  8:49 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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?

Thanks,

—
Daniel Lyons




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

* Re: [9fans] searchfs
  2009-08-06  8:49 [9fans] searchfs Daniel Lyons
@ 2009-08-06 13:07 ` erik quanstrom
  2009-08-06 15:28   ` Russ Cox
  0 siblings, 1 reply; 3+ messages in thread
From: erik quanstrom @ 2009-08-06 13:07 UTC (permalink / raw)
  To: 9fans

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



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

* Re: [9fans] searchfs
  2009-08-06 13:07 ` erik quanstrom
@ 2009-08-06 15:28   ` Russ Cox
  0 siblings, 0 replies; 3+ messages in thread
From: Russ Cox @ 2009-08-06 15:28 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> 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:

for interactive playing, it is easier to use

% aux/rdwr /n/search/search
> search=eat&
...

though maybe the trailing newline would cause trouble.

see /sys/src/cmd/ip/httpd/netlib_find.c for a real client.

russ


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

end of thread, other threads:[~2009-08-06 15:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-06  8:49 [9fans] searchfs Daniel Lyons
2009-08-06 13:07 ` erik quanstrom
2009-08-06 15:28   ` Russ Cox

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