Skip to main content.
home | support | download

Back to List Archive

Re: incremental mental delete question

From: Peter Karman <peter(at)>
Date: Thu May 19 2005 - 13:23:12 GMT
Brad Miele scribbled on 5/19/05 8:00 AM:

> does the file that I am telling the index to delete actually have to
> exist? or am i basically just giving swish-e the name of the file in
> question? and, can i wildcard the name of the files to be deleted, like
> -r hangover*.html

no, the file need not exist, unless you are using the FileSystem method:

karpet@cartermac 137% cat foo.txt
karpet@cartermac 138% cat c
IndexContents TXT* .txt
karpet@cartermac 139% ~/swish/bin/swish-e -i foo.txt -c c
Indexing Data Source: "File-System"
Indexing "foo.txt"
1 file indexed.  7 total bytes.  1 total words.
karpet@cartermac 141% ~/swish/bin/swish-e -w foobar
1000 foo.txt "foo.txt" 7
karpet@cartermac 142% rm foo.txt
karpet@cartermac 143% ~/swish/bin/swish-e -i foo.txt -c c -r
Indexing Data Source: "File-System"
Indexing "foo.txt"
Warning: Invalid path 'foo.txt': No such file or directory
karpet@cartermac 144% ~/swish/bin/swish-e -w foobar
1000 foo.txt "foo.txt" 7

If using -S prog, the file name can be whatever you want; Swish-e doesn't care 
if it "exists" or not, since you give swish-e all the info it wants.

and finally, wildcards are interpreted by the shell, not swish-e. So if:

karpet@cartermac 145% touch hangover_bad.html
karpet@cartermac 146% touch hangover_good.html
karpet@cartermac 147% ls -1 hangover*html
karpet@cartermac 148%

swish-e would accept -i hangover*html. But it would be matched against the 
filesystem, so it would not remove files that didn't exist on the filesystem.

Peter Karman  .  .  peter(at)
Received on Thu May 19 06:23:13 2005