Check File Status - IDL_FileEnsureStatus()

System routines that deal with files must verify that the files have the proper attributes for the intended operation. Use the function IDL_FileEnsureStatus() for this.

IDL_FileEnsureStatus()

int IDL_FileEnsureStatus(int action, int unit, int flags)

action

If the file unit does not satisfy the requirements of the flags argument, IDL_FileEnsureStatus() will issue an error using the IDL_Message() function (see Issuing Error Messages. This action is the argument to IDL_Message() and should be IDL_MSG_RET, IDL_MSG_LONGJMP, or IDL_MSG_IO_LONGJMP.

unit

The Logical Unit Number of the file to be checked.

flags

IDL_FileEnsureStatus() always checks to make sure unit is a valid logical file unit. In addition, flags is a bit mask specifying the file attributes that should be checked. The possible bit values are listed in the following table:

Note: Some of these values are contradictory. The caller must select a consistent set.

If the file unit meets the desired conditions, IDL_FileEnsureStatus() returns TRUE. If it does not meet the conditions, and action was IDL_MSG_RET, then it returns FALSE.