next up previous
Next: File Mapping
Up: MACHINE-DEPENDENT FEATURES
Previous: File Naming

Wild-Card File Searching   

When searching for HDS container files using the "wild-card" facilities provided by HDS_WILD and HDS_EWILD, the following rules apply.

Since traditional UNIX systems do not generally provide callable pattern-matching facilities for finding files, nor do they support the concept of default file type extensions, HDS implements these by passing wild-card file names to a shell process and expanding them using the following algorithm:

1.
The string supplied (which may also be a list of files or file specifications separated by white space) is first expanded with the shell's file name expansion facility turned off. This performs operations such as environment variable substitution and execution of embedded shell commands, but leaves pattern-matching characters in place.
2.
The resulting string is then scanned as a list of file specifications separated by white space.

3.
If any element of this list does not contain a file type extension, as indicated by the absence of a period in the final field (fields being separated by slash characters `/'), then an extension of `.sdf' is appended to it. If an element initially ends in a period, then this is removed and no extension is added. This stage performs file type defaulting on all elements of the list consistent with the rules applied to individual file names (§[*]).

4.
The resulting list of file specifications is then expanded with the shell's file name expansion facility turned on, resulting in the final list of files.

HDS will further filter the list of files found to exclude any which appear not to exist, cannot be accessed, or are not valid HDS container files.



next up previous
Next: File Mapping
Up: MACHINE-DEPENDENT FEATURES
Previous: File Naming

HDS Hierarchical Data System
Starlink User Note 92
R.F. Warren-Smith & M.D. Lawden
23rd February 1999
E-mail:rfws@star.rl.ac.uk

Copyright (C) 1999 Central Laboratory of the Research Councils