VOC F-type records - File definitions

VOC F-Type Records  -  File Definitions

Top  Previous  Next

 

Every file referenced by an application is accessed via an F-type VOC record. This record maps the QM name of the file to the pathnames of the data and dictionary components.

 

1:F  { descriptive text }
2:The pathname(s) of the directory that represents the data portion of the file. In a multi-file, the pathname of each subfile appears as a separate value in this field.
3:Dictionary pathname. This field is empty if the file has no dictionary.
4:Subfile names for a multifile. This field is empty for a simple file.
5:File inclusion flags for ACCOUNT.SAVE and FILE.SAVE.

There are three possible values:

DInclude only the dictionary of this file in the save
EExclude this file from the save
IInclude this file in the save

Leaving the field empty causes ACCOUNT.SAVE and FILE.SAVE to fall back on alternative file selection methods.

6:Special file open modes for QMBasic OPEN and OPENSEQ operations. Value 1 of this field applies to the data part of the file. For a multifile, these modes apply to all elements. Value 2 applies to the dictionary part. Both may be any compatible combination of the codes listed below.
BSets the line terminator for a directory file on read to be either a CR/LF pair or a lone LF, treating lone CR characters as part of the data. On write, the operating system line terminator is used. Ignored for other file types.
CSets the line terminator for a directory file to be a CR/LF pair. Ignored for other file types.
LSets the line terminator for a directory file to be a LF character. Ignored for other file types.
MFor a directory file, causes the file to be opened with mark mapping disabled. This is useful for files containing binary data such as scanned images.
NSpecifies that the file will always be opened non-transactionally when using this VOC item.
RSpecifies that the file is to be read-only when opened using this VOC item.
SSets synchronous (forced write) mode on the file (hashed files only).
TSuppress translation of restricted characters in directory file record ids. This affects only the data portion of the file. See also the NO.MAP option to the QMBasic OPEN statement. This flag can be set using the NO.MAP option to the CREATE.FILE or CONFIGURE.FILE commands.
XSets the line terminator for a directory file to be either a CR/LF pair or a lone LF, stripping lone CR characters. Ignored for other file types.

Applications that make direct access to this field should allow for the presence of codes not in the above list. For a discussion of the line terminator modes see directory files.

7:Default character encoding for this file. This is only relevant to directory files or sequential files. It is valid for a file to be referenced from more than one F-type record with different default encodings. Value 1 of this field applies to the data part of the file. For a multifile, the encoding applies to all elements. Value 2 applies to the dictionary part.

 

Either pathname field may be blank to indicate that the file portion does not exist.

Three special pathname prefixes are allowed:

@QMSYS will be replaced by the QMSYS account directory pathname, ensuring that references to items in the QMSYS account will still function if a new release is installed at a different location.

@TMP will be replaced by the pathname in the TEMPDIR configuration parameter.

@HOME will be replaced by the value of the HOME environment variable on Linux or the HOMEPATH environment variable on Windows. Use of this prefix allows different users to see a different personal version of the same file.

 

By using F-type VOC items to locate files indirectly rather than embedding file pathnames in the application, the VOC entry becomes the only place where the pathname is recorded. If a file is moved, perhaps to balance loading across multiple disks, only the VOC entry needs to be amended; the application itself is not affected.

 

Where two or more accounts share a file, the VOC files in each account could have F-type records mapping the QM name to the pathnames. This is not recommended. Instead, the account that owns the file should have an F-type record and all other accounts should have Q-type records to access the file indirectly.

 

The pathname of either or data or dictionary portion of a file may be specified as

VFS:server:detail

to make use of the Virtual File System.

 

A summary of F-type VOC records may be displayed or printed using

LISTFShow all F-type entries
LISTFLShow only local files (in the account directory)
LISTFRShow only remote files (not in the account directory)