User`s guide
2.3.5 User Number Conventions
The CP/M 3 User facility divides each drive directory into sixteen logically inde-
pendent directories, designated as user 0 through user 15. Physically, all user direc-
tories share the directory area of a drive. In most other aspects, however, they are
independent. For example, files with the same name can exist on different user num-
bers of the same drive with no conflict. However, a single file cannot reside under
more than one user number.
Only one user number is active for a program at one time, and the current user
number applies to all drives on the system. Furthermore, the FCB format does not
contain any field that can be used to override the current user number. As a result,
all file and directory operations reference directories associated with the current user
number. However, it is possible for a program to access files on different user num-
bers; this can be accomplished by setting the user number to the file's user number
with the BDOS Set User function before making the desired BDOS function call for
the file. Note that this technique must be used carefully. An error occurs if a program
attempts to read or write to a file under a user number different from the user
number that was active when the file was opened.
When the CCP loads and executes a transient program, it initializes the user num-
ber to the value displayed in the system prompt. If the system prompt does not
display a user number, user zero is implied. A transient program can change its user
number by making a BDOS Set User function call. Changing the user number in this
way does not affect the CCP's user number displayed in the system prompt. When
the transient program terminates, the CCP's user number is restored. However, an
option of the BDOS Program Chain command allows a program to pass its current
user number and default drive to the chained program.
User 0 has special properties under CP/M 3. When the current user number is not
equal to zero, and if a requested file is not present under the current user number,
the file system automatically attempts to open the file under user zero. If the file
exists under user zero, and if it has the system attribute, t2', set, the file is opened
from user zero. Note, however, that files opened in this way cannot be written to;
they are available only for read access. This procedure allows utilities that may
include overlays and any other commonly accessed files to be placed on user zero,
but also be available for access from other user numbers. As a result, commonly
needed utilities need not be copied to all user numbers on a directory, and you can
control which user zero files are directly accessible from other user numbers.
2-18
2.3 BDOS File System CP/M 3 Programmer's Guide