It is rare that a BASIC+ OPEN statement will fail (fall through its ELSE logic) as a result of a BFS OPEN.FILE call.

Within an BASIC+ program, a failure in an OPEN statement (ELSE logic) is likeliest because the file has not been attached.  If the file is attached but has not yet been opened, a filing system OPEN.FILE call is made. The BFS can choose to create a file handle in any way it likes, but will typically examine the media map for the volume in question, and read the physical file for information required for the file handle.

At this point, an OPEN will fail only if the information in the media map does not correspond to the file in some way, or if the media map itself had changed since the volume as a whole had been read by the ATTACH_TABLE command. For example, if a media map entry pointed to a DOS (or other operating system) file that did not exist, the filing system will likely detect this mismatch.

The OPEN will thus fail at the BFS level; this is indicated by a return value of false in the STATUS variable.

  • No labels