imaccess: Test if an image exists

Package: language

Usage

bool = imaccess (image)

Parameters

image
The name of the image whose existence is to be tested.

Description

Imaccess is a boolean intrinsic function returning true ("yes") if the named image exists. The function will return false ("no") if the image doesn't exist, or if no image extension is supplied and the image name is ambiguous. Imaccess can only be called as a function in an expression, not as a task.

Examples

1. Print the header of an image if it exists.

if (imaccess ("dev$wpix"))
    imheader ("dev$wpix",long+)
else
    error (11, "Image not found")

2. Tell if a image exists.

cl> = imaccess ("dev$pix")

Bugs

An optional second argument should be added to test whether the named file can be accessed for reading or writing.