file ... is readable

operator

Return type:
Switch
Returns:
true if the system path named by string-expression exists and is readable, false otherwise.
Syntax
file string-expression (is | isnt) readable


Purpose

The file ... is readable test is used to determine if the system path named by string-expression exists and is readable by the OmniMark program. This is useful to avoid a program error when reading a file. Using isnt instead of is will reverse the results.

Example

The following program shows how file ... is readable is used to avoid attempting to read a file that cannot be be read:

  find "\input{" [any \ "}"]+ => filename "}"
     do unless file filename is readable
        put #log "ERROR: File " || filename || " does not exist ... skipping.%n"
  
     else
        submit file filename
     done