Product Documentation

BTRV Edition User's Guide

Previous Topic

Next Topic

<file>

The file element specifies file-wide configurations. It is used to delimit options to a specific file identified by the name attribute or to all the files contained in a directory identified by the dir attribute.

The name and dir setting may contain the * wildcard to match multiple files with a single <file> section. The file matching rules that apply when the wildcard * is used are described in Wildcard File Matching Rules.

If multiple file rules match a file, the rules described in File Matching Precedence determine the rules that apply.

Attributes

Attribute

Description

Default Value

name

Specifies the string to match the file name portion of the file path passed by the Btrieve application.

*

dir

Specifies the string to match the directory portion of the file path passed by the Btrieve application. If attribute name is also specified, the option applies to the files that match both the directory and the name.

*

See Empty String Note below.

casesensitive

Specifies if the file name and/or file dir attributes should be matched against the file path considering case sensitivity.

yes (file and directory names are case-sensitive)

priority

Specify the priority of this entry. Accepted values range from ‑32767 to +32767.

0

For "matching all file rules" (a rule matching all files in all directories) the default priority is ‑32767.

type

Specify the file organization. Valid values are:

  • I - Indexed file
  • R - Relative file.
  • L - Line sequential file
  • S - Record sequential file
  • * - Any file type (this is the default)

*

Empty String Note: Setting the dir attribute to an empty string ("") is not the same as using a * wildcard. Instead, it means to match a file path with no directory.

Example

<file name="CUSTMAST" dir=".">

...

</file>

To turn off case sensitivity (the example below would match CUSTMAST, custmast, CustMast, etc.):

<file name="CUSTMAST" dir="." casesensitive="no">

</file>

See Also

In This Section

Wildcard File Matching Rules

File Matching Precedence

Previous Topic

Next Topic

Wildcard File Matching Rules

c-treeRTG allows wildcard file matching. The only wildcard character is: *

The wildcard character can be placed at the beginning of a string, at the end of a string, or both. It is basically a way to say:

  • string* - Match names that begin with the given string.
  • *string - Match names that end with the given string.
  • *string* - Match names that contain the given string.

The file matching rules are not the same as those for Windows. For example, *.* matches any file name containing a "." but it does not match names without a dot (e.g., it matches "customer.dat" but not "customers").

Wildcard matching does not distinguish between file names and extensions. For example, cust* matches customers.dat because the wildcard character can match multiple characters in the file name as well as the extension.

Wildcard

Description

Example

Matches

Does NOT match

string*

The file or directory begins with the specified string and can end with anything.

cust*
(names that begin with "cust")

cust
customer
customers
customers.dat
cust.dat

newcustomer
(does not begin with "cust")

*string

The file or directory ends with the specified string and can begin with anything.

*customer
(names that end with "customer" with no extension)

customer
newcustomer

customer.dat
(the entire file name, including extension, must end with "customer")

*string*

The file or directory contains the specified string and can begin and end with anything.

*cust*
(Names that contain "cust")

customer
newcustomer.dat

 

 

 

*.*
(Names that contain a dot: ".")

customer.dat

customer
(name does not contain a dot: ".")

Summary of Wildcard Rules

If the name/dir setting does not contain a *, the <file> options apply to the files that exactly match the name/dir setting.

If the name/dir setting begins with a *, the <file> options apply to the files for which name/dir ends with the string on the right of the *. For example: <file name="*mast"> matches file name "custmast" but does not match file name "master".

If the name/dir setting ends with a *, the <file> options apply to the files for which name/dir begins with the string on the left of the *. For example: <file name="mast*"> matches file name "master" but does not match file name "custmast".

If the name/dir setting begins with a * and ends with a *, the <file> options apply to the files which name/dir contains the string enclosed between the * and *. For example: <file name="*mast*"> matches file name "master" and file name "custmast".

If the name/dir setting contains only a *, the <file> options apply to all files.

TOCIndex