User's Guide

CHECKSPACE

Check for available disk space

Function:

Check for available disk space. Determines if the output disk contains enough space to hold the input file.

Parameters:

INFILE
Input file. The input host file name used to determine the amount of disk space needed on the output disk. If NULL, the number of bytes to search for must be specified by NBYTES.

NBYTES(--)
Number of bytes. The number of bytes to search for on the output disk. If INFILE is specified, NBYTES is ignored.

DISK
Output disk. The output host disk and/or directory name to search for space.

SPACFLG
Space flag. This flag is set to one if the space available on the output disk is greater than or equal to the size of the input file. Otherwise, the flag is set to negative one.

Examples:

  1. LAS> checkspace infile=[image2]ah11041392081422.img disk=[image1] spacflg=spflag

    The program will see if there is enough space in the [image1] directory on the current default device to hold [image2]ah11041392081422. If there is enough space for it, one will be returned in the TAE variable SPFLAG. If there is not enough space, negative one will be returned.

  2. LAS> checkspace infile=-- nbytes=100000 disk=arch1:[image1] spacflg=spflag

    The program will see if there are 100000 bytes of available disk space in the [image1] directory on the arch1: disk. If there is, one will be returned in the TAE variable SPFLAG. If there is not, negative one will be returned.

  3. LAS> checkspace infile=/sg2/csb/lasdev/ah1104139208142.img disk=/sg2/km1 spacflg=spflag

    The program will see if there is enough space in the /sg2/km1 directory to hold ah1104139208142.img. If there is, one will be returned in the TAE variable SPFLAG. If there is not enough space, negative one will be returned.

Description/Algorithm:

The amount of space available on DISK is calculated and compared to the number of bytes requested in NBYTES (when INFILE is not NULL, the number of requested bytes is determined by the size of the file specified by INFILE). If there is sufficient space available on disk, a one (1) is returned in the TAE variable specified by SPACFLG. If there is not enough space available, a negative one (-1) is returned in the TAE variable specified by SPACFLG.

Nonfatal Error Message:

    None.

Fatal Error Messages:

  1. [checkspace-fatal] Fatal error encountered

    A fatal error was encountered. The message displayed prior to this one is the specific error that was encountered. Processing is terminated.

  2. [checkspace-spec] Either INFILE or NBYTES must be specified

    Specifying both INFILE and NBYTES as NULL does not tell CHECKSPACE how much space to look for. Enter a file name in INFILE or a number of bytes in NBYTES.

User Notes:

  1. INFILE and DISK must be host file and host directory names, respectively. INFILE may include a directory path. An error in INFILE or DISK specification will cause a negative one to be returned.

  2. SPACFLG must contain the name of a TAE integer variable.