When accessing files containing foreign format data, the NDF library will, on occasion, have to delete them (for instance, the routine NDF_DELET might have been called by an application). Normally, this causes no problem, as a named file can easily be deleted when necessary. With some formats, however, this is not so simple. For example, data written in IRAF format will normally reside in two associated files - although the NDF library can delete the one it knows about, the other one would remain in existence.
To overcome this and other similar problems, it is possible to define an explicit deletion command for any foreign format which needs special treatment. If one is defined, it will over-ride any attempt by the NDF library to delete files which it knows are written in that format.
Taking the IRAF format as an example, the command would be defined via the environment variable NDF_DEL_IRAF in the same way as when defining format conversion commands. For example:
setenv NDF_DEL_IRAF 'rm -f ^dir^name.imh ^dir^name.pix'
would unsure that both files associated with the dataset (with extensions `.imh' and `.pix') are deleted when necessary.
The deletion command is invoked in the normal way, by passing it to
the C run time library ``system'' function, having first performed
message token substitution on it (see
§). In this case, the NDF library
defines the following tokens for use in the command: