Guardian Programmer's Guide

Table Of Contents
Using the File System
Guardian Programmer’s Guide 421922-014
2 - 13
Creating Files
secondary extents are allocated. The secondary extents are all the same size, but the
primary extent may be a different size than the secondary extents. Extents are
automatically allocated to the file by the disk process as the need arises up to a file-
dependent maximum value.
Parameters of the FILE_CREATE[LIST]_ procedure allow you to specify the extent
sizes. One parameter specifies the length of the primary extent in pages (2048-byte
units). Another parameter specifies the length of each secondary extent, also in
pages.
The following example allocates a primary extent of 8 megabytes and secondary
extents of 1 megabytes each.
PRIMARY^EXTENT^SIZE := 4096;
SECONDARY^EXTENT^SIZE := 512;
NAME := "$OURVOL.MYSUBVOL.DATAFILE" -> @S^PTR;
LENGTH := @S^PTR '-' @NAME;
ERROR := FILE_CREATE_(NAME:ZSYS^VAL^LEN^FILENAME,
LENGTH,
!file^code!, !not specified
PRIMARY^EXTENT^SIZE,
SECONDARY^EXTENT^SIZE);
So far you have seen how to control the size of the extents allocated to a file. You also
need to set the amount of space that can be allocated to the file by specifying the
maximum number of extents. By default, up to 16 extents can be allocated as needed.
You set the maximum number of extents initially using another parameter of the
FILE_CREATE_ procedure. The following example sets the maximum to 32:
MAX^EXTENTS := 32;
CALL FILE_CREATE_(NAME:ZSYS^VAL^LEN^FILENAME,
LENGTH,
!file^code!,
PRIMARY^EXTENT^SIZE,
SECONDARY^EXTENT^SIZE,
MAX^EXTENTS);
This number can be changed either by using the FUP ALTER command—see the File
Utility Program (FUP) Reference Manual —or programmatically using the SETMODE
procedure call, function 92—see the Guardian Procedure Calls Reference Manual.
Creating Processes
You can create processes either by issuing the RUN command from the TACL
command interpreter or by calling the PROCESS_LAUNCH_ or PROCESS_CREATE_
Guardian procedure from a program. (How to use the PROCESS_LAUNCH_
procedure is explained in Section 16, Creating and Managing Processes.)
The TACL RUN command can create named or unnamed processes. If you use the
NAME option of the RUN command, then a named process is created. Without the
NAME option, the RUN command usually creates an unnamed process, unless the
RUNNAMED flag is specified for the object file, in which case the process is always