When BS2000 DMS files are supported in a bs2fs file system, a distinction must be made
between whether a new file is created or whether it already exists in BS2000.
Newly created DMS files
FCBTYPE
New DMS files created in a bs2fs file system are always of the type FCBTYPE SAM with a variable record length.
BACL (see also "Access attributes")
The BACL attributes are automatically enabled in BS2000 in accordance with the mode specified in open() and the umask setting (
mode & ~umask
).For example, a umask setting of
022
(default in the shell) and a mode pattern of777
result in the protection bit rightsrwx r-x r-x
.When BACL is enabled, modifications are no longer evaluated with /MODIFY-FILE-ATTRIBUTES in USER-ACCESS or ACCESS.
Transfer mode ftyp
Whether a SAM file is transferred to the bs2fs container and back in text, textbin or binary mode depends on the ftyp option of the mount command for the bs2fs file system. The POSIX command ftyp is not evaluated and is reserved for bs2cp. See also mount
command, -o option ftyp.
Existing DMS files
FCBTYPE
Existing DMS files can be of the FCBTYPE SAM, ISAM or PAM. The FCBTYPE is also retained if such a file is overwritten.
The following is meant by overwriting: creat(), open (O_CREAT |O_WRONLY |O_TRUNC), cp command, but not the rename() or mv command.
No FCBTYPE (no open) is yet defined for existing DMS files which were created only by means of /CREATE-FILE or something similar. After being opened as bs2fs files, these files are assigned the FCBTYPE SAM.
BACL (see also "Access attributes")
When write or overwrite accesses take place, all the original protection attributes are retained. If the BACL attributes had not been enabled beforehand, they are also not enabled later. The mode specifications in open() or creat() are, as is customary in POSIX, ignored in the case of existing files.
In the bs2fs file system the BACL properties of existing files without BACL can only be enabled by explicitly modifying the protection attributes with chmod() or the chmod command.
Transfer mode ftyp
ISAM files are always transferred in text mode, PAM files always in binary mode. In the case of SAM files - as with newly created SAM files - the ftyp option of the mount command is relevant for the bs2fs file system.
Take care when copying within the bs2fs world
If the file attributes of the source and the target are different with respect to the transfer mode (text, binary), this can lead to unexpected (data) results.
There is no analogy to the /COPY-FILE command, where the target file is assigned the same FCBTYPE as the source file, when copying using POSIX bs2fs means.
BS2000 file types which are not supported
The following files/libraries are not displayed in a bs2fs file system under POSIX, in other words, for example, they are not output by the ls command:
Exported (migrated) files/libraries (please also observe the notes on handling migrated files in "Various special features of bs2fs")
Alias catalog entries
File generation groups and file generations
Files/libraries which are accessed via RFA
Tape files
Files on private disks
Files protected by a password are visible in the bs2fs file system under POSIX, but their contents can only be accessed by operations which are not protected by a password, e.g. read access to a file protected by a write password.
Files protected by guards are visible in the bs2fs file system under POSIX. Their contents can only be accessed if the protecting guard permits corresponding access for the caller's user ID.
Overview of the open modes of DMS files
DMS files in POSIX are interpreted differently according to their FCBTYPE, the record length and the ftyp option when the bs2fs file system is mounted (see "mount - mount a file system "). An overview of how these properties are mapped to the file type and the corresponding open modes in the bs2fs file system is provided by the table below:
FCBTYPE | ftyp | File type | Open mode | Open mode for writing |
SAM | text (default) | Text file | r | w,tabexp=yes |
binary | Binary file | rb,type=record | wb,type=record,forg=seq | |
textbin | Binary text file | r | w,tabexp=no | |
ISAM | - | Text file | r | w,tabexp=yes |
PAM | - | Binary file | r | wb,type=record |
The record keys of ISAM files are ignored when reading; when writing, numeric record keys (in character representation) are generated.