Drive: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
Line 25: Line 25:
[[Windows]] uses case insensitive filenames, whereas all Unix derivatives (Linux and [[Mac]]) use case sensitive filenames. Therefore, the second parameter of the drive statement is case sensitive for Linux and Mac, but not for Windows. All other drive statement parameters are case insensitive.  
[[Windows]] uses case insensitive filenames, whereas all Unix derivatives (Linux and [[Mac]]) use case sensitive filenames. Therefore, the second parameter of the drive statement is case sensitive for Linux and Mac, but not for Windows. All other drive statement parameters are case insensitive.  


The Windows model of BR permits accessing drives without drive statements, but the [[Status]] command does not report the configuration of such drives.  Therefore you are encouraged to get familiar with the drive statement, and begin using it.
The Windows model of BR permits accessing drives without drive statements, but the [[Status]] command does not report the configuration of such drives, and file  and record locking is not performed on such drives.  Therefore you are encouraged to get familiar with the drive statement, and begin using it.


Other BRConfig.sys statement pathnames are subject to preceding drive definitions. In other words any pathname references in the BRConfig.sys file (other than tose appearing in Drive statements) will be translated to OS pathnames via preceding Drive statements.  To use actual OS pathnames in BR, begin the names with a colon (which is removed when the pathname is utilized by BR).
Other BRConfig.sys statement pathnames are subject to preceding drive definitions. In other words any pathname references in the BRConfig.sys file (other than tose appearing in Drive statements) will be translated to OS pathnames via preceding Drive statements.  To use actual OS pathnames in BR, begin the names with a colon (which is removed when the pathname is utilized by BR).




"Drive-id" is the Windows-like drive letter (A-Z) appearing in a BR program OPEN string filename (e.g. C:).
"drive-letter" is the Windows-like drive letter (A-Z) appearing in a BR program OPEN string filename (e.g. C:).


"server-full-path" is the actual OS full pathname to the directory referenced by the drive-id. (e.g E:\CUSTFILES or \\MYSERVER\CUST_SHARENAME\) '''Note that UNC names (beginning with \\server-name) operate significantly faster than Drive letter mappings.'''
"server-full-path" is the actual OS full pathname to the directory referenced by the drive-id. (e.g E:\CUSTFILES or \\MYSERVER\CUST_SHARENAME\) '''Note that UNC names (beginning with \\server-name) operate significantly faster than drive letter mappings.'''


"initial-directory" is the parameter of an implied beginning CD command on the drive.  BR acts as though your application changed to this subdirectory during startup.
"subdirectory" is the parameter of an implied beginning CD command on the drive.  BR acts as though your application changed to this subdirectory during startup.


  DRIVE C:,F:\MYAPP,SERVER-2,\PRL
  DRIVE C:,F:\MYAPP,SERVER-2,\PRL
Line 41: Line 41:


BR assumes that any references to undefined drives (F:, G:, etc.) refer to the root directory on those drives.  Also, RECORD LOCKING IS NOT PERFORMED ON SUCH DRIVES. The [[Protect]] Reserve command only works on filenames that pertain to drives that are identified by a drive statement.
BR assumes that any references to undefined drives (F:, G:, etc.) refer to the root directory on those drives.  Also, RECORD LOCKING IS NOT PERFORMED ON SUCH DRIVES. The [[Protect]] Reserve command only works on filenames that pertain to drives that are identified by a drive statement.


====BR file search order during file OPEN processing====
====BR file search order during file OPEN processing====

Revision as of 18:13, 20 September 2019

The Drive BRConfig.sys specification abstracts ( translates ) hardware disk storage and network setups to make applications more portable. The Drive specification also allows Linux files to be accessed with MS Windows naming conventions.

Syntax

DRIVE <drive letter>[:], <server-full-pathname>, [<client-full-pathname>], \[<subdirectory-name>]


"drive-letter" is the letter to be assigned and may be followed by a colon. Commas must be used as separators between parameters.

"server-full-pathname" is the OS full pathname and may include the OS drive reference (see examples below). Within BR this will appear to be the root directory on that drive.

"client-full-pathname" is optional and identifies the initial working directory on the client computer.

"subdirectory-name" is optional and specifies a directory beneath the directory specified in the second parameter. The specified name becomes the current directory and must be preceded by a forward slash. This parameter is case-sensitive; Business Rules will not translate uppercase specifications into lowercase letters.

Technical Considerations

  1. The first Drive specification identifies the initial current directory when Business Rules! is started.
  2. At least one Drive specification is required in the BRConfig.sys file. This makes it clear where the initial working directory is. While the Windows model permits startup with no Drive statement, and permits references to drives with no Drive statement, file sharing protection is not implemented for such drives.
  3. The only place that Drive can be specified is in the BRConfig.sys file; it is not valid with the config command.
  4. Drive statements must have four parameters. The third parameter may have a null value (be left empty). A backslash in the fourth parameter may be used to startup in the OS directory specified by the second parameter.

Comments and Examples

Business Rules! utilizes a file naming structure similar to MS Windows for file and path references. In BR pathnames backslashes ( \ ) are used to separate directory names even when running on Linux. Also on Linux all filenames specified in programs are set to lowercase when converting to OS filenames irrespective of the case used by BR programs. This is done to simulate case insensitive filenames. Note: this feature may be overridden by the FileNames configuration statement.

Windows uses case insensitive filenames, whereas all Unix derivatives (Linux and Mac) use case sensitive filenames. Therefore, the second parameter of the drive statement is case sensitive for Linux and Mac, but not for Windows. All other drive statement parameters are case insensitive.

The Windows model of BR permits accessing drives without drive statements, but the Status command does not report the configuration of such drives, and file and record locking is not performed on such drives. Therefore you are encouraged to get familiar with the drive statement, and begin using it.

Other BRConfig.sys statement pathnames are subject to preceding drive definitions. In other words any pathname references in the BRConfig.sys file (other than tose appearing in Drive statements) will be translated to OS pathnames via preceding Drive statements. To use actual OS pathnames in BR, begin the names with a colon (which is removed when the pathname is utilized by BR).


"drive-letter" is the Windows-like drive letter (A-Z) appearing in a BR program OPEN string filename (e.g. C:).

"server-full-path" is the actual OS full pathname to the directory referenced by the drive-id. (e.g E:\CUSTFILES or \\MYSERVER\CUST_SHARENAME\) Note that UNC names (beginning with \\server-name) operate significantly faster than drive letter mappings.

"subdirectory" is the parameter of an implied beginning CD command on the drive. BR acts as though your application changed to this subdirectory during startup.

DRIVE C:,F:\MYAPP,SERVER-2,\PRL

Defines a network node (F:\MYAPP) as the C: drive and performs an implied CD \PRL on this drive during startup.

BR assumes that any references to undefined drives (F:, G:, etc.) refer to the root directory on those drives. Also, RECORD LOCKING IS NOT PERFORMED ON SUCH DRIVES. The Protect Reserve command only works on filenames that pertain to drives that are identified by a drive statement.

BR file search order during file OPEN processing

BR32.EXE Windows Working Directory or UNIX current directory. Note that this may be different from the actual location of BR if a full pathname is given as the executable. This is regarded as the BR executable directory.
BRConfig.sys Command Line Parameter or BR executable directory
WBCmd.wbh First Drive location
BRServer.dat BRServer configuration statement or first Drive location
BRSerial.dat BR executable directory
WBTerm.out BR executable directory
Initial 'current' directory First Drive location

Note that pathnames given in BRConfig.sys statements are subject to preceding DRIVE statements. To use actual OS pathnames, begin the names with a colon (which is stripped by BR).