CREATE.FILE

Top  Previous  Next

 

The CREATE.FILE command is used to create a QM file.

 

 

Format

 

CREATE.FILE {portion} file.name {, subfile} {type} {configuration}

{USING DICT other.file} {ENCRYPT keyname} {NO.QUERY}

 

where

 

portionidentifies the part of the file to create. This may be DATA to create just the data portion, DICT to create just the dictionary portion or omitted to create both.

 

file.nameis the name of the VOC record to be created to refer to the file. By default, the operating system pathname used for the directory representing the data file is the same as file.name and the directory for the dictionary component of a file is the same but with a .DIC suffix.

 

subfileis the name of the subfile to be created in a multifile.

 

typespecifies the file type as DIRECTORY or DYNAMIC. If omitted, a dynamic file is created by default. Dictionaries are always created as dynamic files regardless of any type argument.

 

 

The configuration options available when creating a dynamic file to specify the file's configuration and location are:

 

CASEcreates a file where the record ids will be treated as case sensitive. This is the default action unless the CREATE.FILE.NO.CASE mode of the OPTION command is enabled.

 

PATHNAME pathspecifies the pathname of an existing operating system directory under which the file is to be created.

 

MINIMUM.MODULUS nsets the minimum modulus for the file. Any positive non-zero value may be used. The default is 1.

 

GROUP.SIZE sizesets the group size as a multiple of 1024 bytes. This must be in the range 1 to 8. If omitted, the default group size is taken from the GRPSIZE configuration parameter.

 

LARGE.RECORD bytessets the large record size in bytes. The default is 80% of the group size.

 

SPLIT.LOAD pctsets the split load factor for the file. The default is 80%.

 

MERGE.LOAD pctsets the merge load factor for the file. The default is 50%.

 

VERSION vnoallows creation of files with internal formats compatible with older releases of QM.

 

NO.CASEcreates a file where the record ids will be treated as case insensitive. QM will write records preserving the casing specified by whatever performs the write. Reads will locate records regardless of casing. The CREATE.FILE.NO.CASE mode of the OPTION command can be used to make this the default action.
NO.RESIZEcreates the file with resizing disabled. See CONFIGURE.FILE and dynamic files for more information.

 

{MODES ddd{:sss}}sets file permission modes (not Windows).

 

 

The configuration options available when creating a directory file are:

 

PATHNAME pathspecifies the pathname of an existing operating system directory under which the file is to be created.

 

NO.MAPsuppresses mapping of characters in directory file record names that are normally restricted. This option affects only the data portion of the file and is therefore invalid when the DICT keyword is present. Note that when this option is used the application is responsible for ensuring that record names comply with operating system file name rules.  See directory files for more information.

 

 

The USING DICT clause allows creation of a data file that is to share the dictionary of an existing file. The effect of this option is to copy the content of field 3 of the VOC entry for other.file into field 3 of the newly created entry rather than setting up a new dictionary.

 

The ENCRYPT keyword enables record level data encryption and prefixes the name of the encryption key to be used.

 

The NO.QUERY option suppresses any confirmation prompts associated with the requested action.

 

Case sensitivity of record ids in directory files is dependent on the operating system.

 

To provide maximum flexibility, QM imposes no restrictions on the file name except that it may not contain the mark characters or the ASCII null character. Use of spaces in file names is not recommended as it is likely to lead to problems with some commands. Characters that are not valid in operating system file names are automatically transformed using the same translations as described for directory file record ids.

 

By default, the directories created at the operating system level to represent the QM file and its dictionary have their names converted to uppercase. The KEEP.FILENAME.CASE mode of the OPTION command can be used to suppress this conversion.

 

 

 

Multifiles

 

A multifile is a collection of data files that share a common dictionary. Commands and application software refer to an individual subfile within the multifile by using a name that consists of the file name and subfile name separated by a comma.

 

When creating a multifile element, the default action of CREATE.FILE is to create a subdirectory named file.name under the account and create the element within this directory as subfile. An alternative location can be specified using the PATHNAME parameter.

 

The CREATE.FILE command can convert an existing simple file into a multifile. The existing data becomes a subfile with the same name as the file.

 

 

File Permission Modes

 

The MODE option can be used to set the file access permissions for the newly created file and its dictionary. This option is ignored on Windows. The ddd element is the octal value for the permission flags to be applied to the directory that represents the QM file. These values are as used on Linux, FreeBSD and AIX where the first digit is the permissions for the owner of the file, the second digit is the permissions for other users in the group to which the file is assigned, and the third digit is permissions for all other users. Each digit is formed by adding 4 (write), 2 (read) and 1 (execute).

 

The sss element is the octal value for the permission flags to be applied to subfiles in the directory when creating a hashed file. If omitted, this defaults to the same value as ddd.

 

If the MODE option is not used, the file permissions are taken from the current operating system umask value.

 

 

Examples

 

CREATE.FILE STOCK MINIMUM.MODULUS 150 GROUP.SIZE 4

 

This statement creates a dynamic file named STOCK with minimum modulus of 150 and group size 4.

 

 

CREATE.FILE INVOICES MODE 775:660

 

This statement creates a dynamic file named INVOICES. The directory representing this file will have permission flags of 775 and the subfiles in the directory will have permission flags of 660.

 

 

CREATE.FILE SALES ENCRYPT SALESKEY

 

This statement creates a dynamic file named SALES and applies record level data encryption using the SALESKEY key.

 

 

CREATE.FILE DATA PROGRAMS DIRECTORY PATHNAME D:\APPS

 

This statement creates the data portion of a directory file named PROGRAMS. The full pathname for this directory file is specified as D:\APPS\PROGRAMS  rather than using the default location.

 

 

CREATE.FILE ACCOUNTS,NORTH

 

This statement creates a multifile component named NORTH within the ACCOUNTS file.

 

 

See also:

CONFIGURE.FILE, DELETE.FILE, LISTF, LISTFL, LISTFR, data encryption, CREATE.KEY, ENCRYPT.FILE