ATTACH - attach file to task file list.

Usage:

B:
   retunit = attach( filecode, unit );
   retunit = attach( filecode, filename, options, ... );
C:
   int attach(const char *filecode, int unit);
   int attach(const char *filecode, const char *filename,
              const char *options, ...);

Where:

filecode
is a two-character ASCII string containing the filecode with which the given file is to be associated.
unit
is the unit number of a file which has already been accessed by OPEN.
filename, options, ...
are arguments which are passed to OPEN to access the desired file.
retunit
receives a -1 if "unit" is given and refers to an I/O unit which is not already open. Otherwise, ATTACH returns the value which was returned by OPEN when the attempt was made to access the given file. Usually this returned value is the number of the unit assigned to the file.

Description:

ATTACH associates the name of an open file as it appears in the AFT with a two-character filecode to be used in batch. ATTACH also enters this association into the file list for DRL TASK.

If two arguments are passed to ATTACH, it assumes that the second is the unit number associated with a file that is already open. If more than two arguments are passed to ATTACH, it passes all but the first argument to OPEN so that the desired file can be accessed before it is attached to the task file list.

ATTACH is intended to be used in conjunction with the library function TASK, which submits a job to batch via DRL TASK.

Examples:

attach( "i**", .read() );
attach( "****", "b/etc/qstar", "rb" );

Note the use of the '**' escape sequence for '*' in the B strings above.

See Also:

expl b lib open

expl b lib task

Copyright © 1996, Thinkage Ltd.