Lockbyte Concepts

Historically, one of the fundamental requirements in a Business BASIC operating environment has been that it should never be possible to erase or lock a file if it is in use. PRO/5 meets this requirement by locking at least one byte in each file opened. Thus, the operating system lets PRO/5 know that the file is in use.

All operating systems supporting PRO/5 permit that "lockbyte" to be located at a byte offset that is beyond the last actual byte of data in the file. PRO/5 takes advantage of this in order to reduce the possibility that the lockbyte will overlap with record data.

In versions of PRO/5 prior to 2.10, many of the supported operating systems had differing limits on the size of files, and the supported file lock ranges. Due to those limitations, BBx and PRO/5 had a default base lock range value of 40000000 hex, with the ability to allow the modification of that value in the config.bbx file. On today's modern operating systems, the 1GB limits no longer exist. Therefore, the need for an adjustable lockbyte is no longer warranted and has been removed.

Entering the following keyword in a config.bbx file disables the entire lockbyte mechanism:

NO_LOCKBYTE

Disabling the lockbyte mechanism has the following effects.

  • Files can be as large as the OS permits.

  • Files opened by one user can be ERASEd or even LOCKed out by another user.

Generally, the few bytes (less than 256KB) gained with NO_LOCKBYTE are not worth the risk.

The NO_LOCKBYTE flag is not available under Multi-User DOS Networks and Multi-User DOS 386 Networks. It is available on all other platforms, including MS-DOS products for Novell networks.

Lockbyte Adjustments in PRO/5 Versions 2.0x and Previous

The following information is applicable to PRO/5 2.0x and earlier versions only.

Lockbyte parameters can be altered with the following config.bbx entry:

LOCKMAX=<hex value>

For example:

LOCKMAX=7fffffff

This selects the base offset to use for lockbytes. The default value is 40000000 hex, or 1GB. On UNIX operating systems, the practical limit is usually 7fffffff, the largest signed quantity representable in 32 bits. In MS-DOS environments, the limit is ffffffff, the largest unsigned quantity representable in 32 bits.

NO_LOCKBYTE

If this keyword appears in a config.bbx file, the entire "lockbyte" mechanism is disabled. This has the following effects.

  • Files can be as large as the OS permits.

  • Files opened by another user can be ERASEd or even LOCKed out from under them!

Generally, the few bytes (less than 256KB) gained with NO_LOCKBYTE are not worth the risk.

The NO_LOCKBYTE flag is not available under Multi-User DOS Networks and Multi-User DOS 386 Networks. It is available on all other platforms, including MS-DOS products for Novell networks.

WARNING - Unless all PRO/5 products use the same values for these parameters, incorrect behavior will result. Do not adjust these parameters if files must be shared with any PRO/5 or PRO/5 Data Server™older than BBxPROGRESSION/4rev2.2. Test the behavior of your system carefully, as this feature will not work correctly on all operating systems, and BASIS does not currently guarantee that it will work on any operating system. Unless your data files exceed 2GB in size, we highly recommend keeping LOCKMAX at 7fffffff or less.