Accessing Files Programmer's Guide (32650-90885)

74 Chapter3
Specifying a File Designation
User-Defined Files
As another example, suppose that you are logged on under the group name XGROUP but
wish to reference a file named X3 that is assigned to the Public Group of your account. If
your program refers to this file by the name FILLER, you would enter:
FILE FILLER=X3.PUB
When you reference a file that does not belong to your logon account, you must use an even
more extensive form of the
filereference
format. With this form, you include both group
name and account name. The account name follows the group name, and is separated from
it by a period. Embedded blanks are not permitted. As an example, suppose you are logged
on under the account named MYACCT but wish to reference the file named GENINFO in the
public group of the system account. Your program references this file under the formal
designator GENFILE. You would enter:
FILE GENFILE=GENINFO.PUB.SYS
A file reference that includes the file name, group, and account is called a fully qualified
file name.
NOTE
You can create a new file only within your logon account; therefore, if you
wish to have a new file under a different account, you log on to the other
account and create the file in that account and group.
In summary, remember that if you do not supply a group name or account name in your
filereference
, MPE/iX supplies the defaults of the group and account in which you are
currently logged on.
Lockwords
When you create a disk file, you can assign to it a lockword that must thereafter be
supplied (as part of the
filereference
format) to access the file in any way. This lockword
is independent of, and serves in addition to, the other file system security provisions
governing the file.
You assign a lockword to a new file by specifying it in the
filereference
parameter of the
BUILD command or the
formaldesignator
parameter of the HPFOPEN/FOPEN intrinsic used
to create the file. For example, to assign the lockword SESAME to a new file named FILEA,
you could enter the following BUILD command:
BUILD FILEA/SESAME <---- Lockword
From this point on, whenever you, or another user, reference the file in an MPE/iX
command or HPFOPEN/FOPEN intrinsic, you must supply the lockword. It is important to
remember that you need the lockword even if you are the creator of the file. Lockwords,
however, are required only for old files on disk.
When referencing a file protected by a lockword, supply the lockword in the following
manner:
In batch mode, supply the lockword as part of the file designator (
filereference
format) specified in the FILE command or HPFOPEN/FOPEN intrinsic call used to
establish access to the file. Enter the lockword after the file name, separated from it by
a slash mark. Neither the file name nor the lockword should contain embedded blanks.