Bundled Homer filters
When regular expression are used in these filters, the extended POSIX syntax is used. The consequence is that if you want ot match a file name based on its extension (say "cpp"), the regular expression to use is:
.*\.cpp
Note the escaped dot sign.
AttributeFilter
This filter determines whether the entry has an attribute based on certain criteria.
The special attribute name "*" is used as a wilcard, exactly like in regular
expressions. A regular expression (extended POSIX syntax is also supported). If the
"case sensitive box" is checked, the search of name attribute is case sensitive.
The type of the attribute can be specified, provided that it is in the pre-defined list.
The special "*" type value (matching B_ANY_TYPE) can be used if the actual type
of the attribute is not an issue.
The value of the attribute can also be a criteria. You can compare it with the value and
operator that you provide. If the type is not "*", then, value is interpreted.
Again, a value of "*" means that the value is not a criteria. (note that the
value can't be a regular expression).
Here are a few combinations that you might consider:
name | case sensitive | type | operator | value | meaning |
azerty | N | * | - | - | an attribute named "azerty" exists |
azerty | Y | * | - | - | an attribute named "azerty" regardless of the case exists (azerty, Azerty, aZerty, AZeRty, ... are matched) |
* | * | int64 | - | * | an attribute with type int64 exists |
* | * | int64 | < | 56 | an attribute with type int64 exists and has a value less than 56 |
ExternFilter
This filter whether to accept the entry based on the result of an extern command which can be a shell or binary application. You can't specify the arguments of the shell/application you call. For instance a shell which checks that an entry is a directory is (0 means true, 1 means false)
#!/bin/sh
if [ $# != 1 ]
then
exit 1 # error
fi
if [ -d $1 ]
then
exit 0 # it's a directory
fi
exit 1 # it's NOT a directory
Alternatively, you can compile a C++ program:
#include <storage/Entry.h>
extern int main();
int main(int argc, char** argv)
{
if (argc != 2)
return 1;
BEntry e(argv[1], false);
if (e.InitCheck() != B_OK)
return 1;
if (e.IsDirectory())
return 0;
return 1;
}
You can drag and drop a file onto the view to select the shell/application to use.
MimeFilter
This filter determines whether the entry's MIME type matches that is given. The supertype is contrained to the set of standard supertypes. The sub-type is free and can be reset by clicking the "*" button. You can drag and drop a file onto the view to set the MIME type.
NameFilter
This filter determines whether the entry has the name described in the view. You can use a regular expression (case sensitive or not), or specify an immediate value with an operator (<, >=, ==, ...)
TimeFilter
This filter determines whether the entry has a creation of modification date matching that specified in the view. The access time is disabled because unused by the BeOS. The time uses the 24-hours scheme. You can drag and drop a file to set the time & date in the view (it's the dropped file's modification time & date which are used)
TypeFilter
This filter determines whether the entry has the type file, directory or symbolic link. The "traverse links" box can be checked to... er... traverse links. Note that checking it and selecting the type "symbolic link" will always return false.
VoidFilter
This filter does nothing but returning true. You can use it to specify an ELSE condition. For instance, having the following script body:
name matches [a-z]+
command1
VoidFilter
command2
will run command1 for each entry whose name is composed of alphabethical characters, command2 otherwise.
This page was last updated on 12/12/99.