Version 10 of snitvfs

Updated 2004-07-30 23:17:43 by SEH

20040722 CMcC: A variant of A template virtual filesystem implemented in Snit.

http://sharedtech.dyndns.org/~colin/snitvfs.tar.gz contains snitvfs and mkvfs - a complete and more functional reimplementation of mk4vfs. Needs testing.

20040723 CMcC: Update - fixed bugs in mkvfs due to perms.


KWIC in mkvfs

Wikit content is built on a metakit view which is like a restricted mkvfs or mk4vfs. It is this which gives Wikit its ability to search for keywords in content and titles (see Wikit in abstract). This facility is also available, for free, in mkvfs. All you have to do is restrict yourself to -nocompress (ie: uncompressed) files. Mk4vfs, which mkvfs is derived from, did not permit per-mount selection of compression, which is one reason I rewrote it.

This facility would be useful in constructing websites, where you get a Search facility essentially for free.

To illustrate this facility, and the utility of making vfs implementations out of Snit, I have added a select and a keyword method:

  • $vfs select {expand}$args will return a list of inodes given a metakit select phrase.
  • $vfs keyword $word will return a list of inodes whose contents contain the given word.

I'll add an inode2path method, but it's pretty trivial.

Extension of this kind of functionality to support the other Wikit primitives should be straight forward.

Using SEH's Collating vfs gives you caching for free, similarly with his versioning vfs.

Given a small set of vfs you can assemble quite complex functionality.

NB: the term for free above means for no/little programming effort, and not (of course) for no computational cost.


[Category VFS]