F.SHRI - shrink an open permfile.

Usage:

stat = f.shri( unit, newsize[, errprint] )

Where:

unit
is an open B lib unit for the file to be shrunk.
newsize
is the requested new file size in llinks.
errprint
is an optional routine which is called in case of error. It is called with a PRINTF type argument list. The default error function is ERROR.
stat
is zero for success, or the negative of the FMS status if the call fails and errprint returns.

Description:

A call to F.SHRI will cause the given permfile to be truncated to the given number of llinks. The file must be accessed for write, and no one else can have the file accessed.

If the operation succeeds, F.SHRI will return zero, the file will be rewound, and the IOV file size will be updated.

If an error occurs during the truncation operation, F.SHRI calls the errprint function, and if this returns, F.SHRI will return the negative of the FMS status. The user can find the full FMS status in the external "f.stat". The default errprint routine (ERROR) displays the error message on the terminal and terminates the program.

Notes:

At most sites, the FMS truncator call is only available in batch. F.SHRI in time sharing will run a task job in order to truncate the file, so a snumb and the message "Normal termination" will be displayed on the terminal for each file truncated.

Files Used:

fc*** - used in TSS as the ** file for the task job

See Also:

expl b syslib extern -- for a description of "f.stat".

Copyright © 1996, Thinkage Ltd.