Drive: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
The '''Drive''' [[BRConfig.sys]] specification is a drive letter followed by a colon. The drive parameter may specify locations on your hard drive, certain special devices such as a printer or modem.
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 [[Windows|MS Windows]] naming conventions.


The first Drive specification defines the default directory when [[Business Rules!]] is started.
====Syntax====
DRIVE <drive letter>[:], <server-full-pathname>, [<client-full-pathname>], \[<subdirectory-name>]
[[file:Drive.png|700px]]


====Comments and Examples====
Business Rules! utilizes a [[DOS]]-like naming structure for all file and path references. The Drive specification allows [[Unix]] or [[Linux]] files to be accessed with DOS naming conventions.


[[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 statements are case insensitive.
"drive-letter" is the letter to be assigned and may be followed by a colon. Commas must be used as separators between parameters.  


The Windows model 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.
"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.  


BRConfig.sys statement pathnames are subject to preceding drive definitionsTo use actual pathnames, begin the names with a colon.
"client-full-pathname" is optional and identifies the initial working directory on the client computer.   


====Syntax====
"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.
DRIVE <drive letter>, /<subdirectory path> [\<directory name>]
[[image:Drive.png|700px]]


====Parameters====
====Technical Considerations====
"Drive-letter" is the letter to be assigned and must be followed by a comma.
# The first Drive specification identifies the initial current directory when [[Business Rules!]] is started.
# 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.
# The only place that Drive can be specified is in the BRConfig.sys file; it is not valid with the [[config]] command.
# 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.


The "Sub-directory path" must start with the root directory, end with the directory containing Business Rules, and be preceded by a forward slash. This parameter is case-sensitive; Business Rules will not translate uppercase specifications into lowercase letters.
====Comments and Examples====
 
Business Rules! utilizes a file naming structure similar to [[Windows|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.  
"Directory name" is optional and specifies a directory beneath the directory containing Business Rules. 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.
 
====Start-up Default====
At least one drive specification is required in the BRConfig.sys file for Unix/Linux/Windows/Mac versions of Business Rules! prior to release [[4.18]].


====Technical Considerations====
[[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 only place that drive can be specified is in the BRConfig.sys file; it is not valid with the [[config]] command.
# There must be at least one drive statement as it was in Unix which makes it clear where the initial working directory is.  In version [[3.8]] drive statements were required only for file sharing.
# Drive statements must now have four parameters. This avoids any confusion about whether or not a drive statement with three parameters was intended under [[3.9]] or whether it was left over from prior versions of BR.  A backslash in the fourth parameter may be used to startup in the directory specified by the second parameter.


===Drive Definition===
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.
The drive definition has the following format:


  DRIVE drive-id[:],actual-drive-path,\current-dir-path
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 drive letter (A-Z) appearing in the BR program OPEN string filename (e.g. C:).


"Actual-drive-path" is the actual full pathname to the node 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.
"drive-letter" is the Windows-like drive letter (A-Z) appearing in a BR program OPEN string filename (e.g. C:).


"Current-dir" is the parameter of an implied beginning CD command on the drive. BR acts as though your application changed to this subdirectory during startup.
"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.'''


For example:
"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


Defines a network node (F:\\MYAPP) as the C: drive and performs an implied CD \PRL on this drive during startup.
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 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.


====Summary of the BR file search order====
====BR file search order during file OPEN processing====


{|
{|
|-valign="top"
|-valign="top"
|width="10%"|'''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.
|width="10%"|'''BR executable'''||''Windows Working Directory or Linux/MAC current directory at the time BR is invoked.'' Note that this may be different from the actual location of BR if a full pathname is given as the executable ( typically from within a startup script ). This "current working directory" is regarded as the BR executable directory.
|-valign="top"
|-valign="top"
|}
|}
Line 74: Line 66:
|}
|}


Note that pathnames given in BRConfig.sys statements are subject to preceding DRIVE statements.  To use actual pathnames, begin the names with a colon.
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).


<noinclude>
<noinclude>

Latest revision as of 18:28, 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

BR executable Windows Working Directory or Linux/MAC current directory at the time BR is invoked. Note that this may be different from the actual location of BR if a full pathname is given as the executable ( typically from within a startup script ). This "current working directory" 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).