Skip to main content.
home | support | download

Back to List Archive

Indexing files from standard input

From: Paul J. Lucas <pjl(at)>
Date: Fri Dec 18 1998 - 01:51:56 GMT
	Somebody using SWISH++ recently sent me mail lamenting the lack
	of the FileRules feature of SWISH-E.  It turns out there is a
	very simple solution to achieve the same effect without adding
	FileRules to SWISH++ at all: simply give SWISH++ the ability to
	read file and directory names from standard input, e.g.:

	find . -name SCCS -prune -o -type f -a -print | index -e txt -

	The above example uses the Unix find command to specify the set
	of files to index, but, of course, you could use any process
	you please including some elaborate, custom Perl script that
	could do things that FileRules would be incapable of doing.

	(Note: in the example, you need the "-type f" since you don't
	want directories to be output since SWISH++ would recurse into
	those directories...but the 'find' is also recursing so you'd
	end up indexing files twice.)

	The question is: for files and directories specified in this
	way (via standard input), should SWISH++ not use filename
	extensions at all?  Presumeably, it would rely on you (the
	author of the command piping into 'index') knowing what you are


	- Paul

	P.S.: Unrelated tidbit: the final 1.4 version of SWISH++ will
	yield about a 17% speed improvement over version 1.3.2.  I ran
	the code through gprof and tweak hotspots.  :)
Received on Thu Dec 17 17:52:28 1998