Creating a Registered Query Routine
A query routine inspects a specified file and attempts to determine whether the file is of a particular file type. While a query routine can provide any type of information about the inspected file, for the purposes of custom file readers registered for use by the IOPEN procedure and the File → Open menu item in the IDL Workbench, query routines simply report whether the specified file is of the particular type.
Tip
See the documentation for
QUERY_IMAGE or any of the other QUERY_* routines for additional information about query routines.
In order for a query routine to be use alongside a registered file reader, it must meet the following criteria:
- It must have the routine signature described below.
- The query routine's
.profile must be present in a directory included in IDL's !PATH system variable. - It must be added to the
idlextenions.xmlfile as described in Registering Custom File Readers.
You do not need to create a query routine in order to register your file reader routine for use with the IOPEN procedure and the File → Open menu item in the IDL Workbench. If no query routine is specified to correspond to a particular file reader routine, that file reader routine will always be used when the specified file has an extension that matches the list specified for the file reader. Query routines are useful, however, if the data files have file extensions that are not specified in the idlextenions.xml file, or no file extension at all. See File Reader Search Algorithm for details.
See Example: A Workbench NetCDF Reader for an example of a custom query routine.
Query Routine Signature
A query routine should be an IDL function with the following signature:
where: