Please enable JavaScript to view this site.

A-Shell Reference

This mode causes any files opened subsequently for Random’Forced access within the current program to be treated as if the Read’Only open flag had been specified. Since Read’Only was not introduced into BASIC until late in the game, some developers use ASFLAG instead to maintain source code compatibility with early versions of the BASIC compiler, supplying a dummy version of ASFLAG.

The original motivation for Read'Only was strictly to avoid file locking conflicts in a program that was merely reading records and did not care whether they were locked, such as in a report. Under A-Shell/Unix, this is the default behavior anyway, so the original motivation is only applicable to Windows platforms. However, there is another motivation for this mode, which applies to all networked A-Shell platforms: it can dramatically speed up file access, even if there are no other users accessing the same file. The reason has to do with eliminating the need for communication between the client process and the locking daemon on the server, which is especially slow under NFS and some Windows networks. Experimenting with this is relatively simple, since you can always "remove" the ASFLAG calls by simply aliasing ASFLAG to a null subroutine, like PRIV (e.g. ALIAS=ASFLAG:PRIV).