Unix Disk Handling Routines

The dk service routines access the UNIX disk handling facilities. These routines should be called from any application program that creates and/or deletes an ancillary or a temporary file directly. The image I/O service and DDR routines use the dk package internally--and thus the application program should not access the dk routines when using these subroutine packages.

Since the dk service routines are only used on some UNIX machines, UNIX_DISK will be defined for the machines needing the facility. UNIX_DISK will be used by the dk service routines to do the correct type of file creation.

An example follows:


     /* create a temporary file....*/

           filesize = number_lines * number_samples * number_bytes_pixel;
           c_dkcre(0, tempfi[i], filesize, 600);
           if((tpfdsc = open(tempfi[i], 1)) == 1)
                c_errmsg("Error opening temporary file.", "error-error", 1);

     /* delete a temporary file....*/

            c_dkdel(tempfi[i]);

A program can access these routines by linking in the following object library:

     $LASLIB/las.a  
The UNIX operating system does not have the ability to link disk packs together under one user code. A utility, using the environment variable DATAPATH and a soft link, has been implemented in LAS to handle the situation when a particular user needs room on more than one disk. It physically places images on the disks named in DATAPATH by a soft link.

This utility also keeps track of the physical space on the disk so that two images being created at the same time do not allocate the same disk area. One of the "creates" will reserve the disk space and the other will be forced to utilize DATAPATH or to wait for disk spae to become available.

Below is the syntax for setting up DATAPATH:

     setenv DATAPATH /edc/production/lams:/edc/production3/lams
The colon is used to separate each of the directories.

NOTES:

  1. This currently only applies to images. The associated files are stored in the working directory.
  2. The account specified in DATAPATH must exist.
  3. A best fit algorithm is used to determine which disk to use for a particular image.
  4. UNIX operating system commands must not be used when working with these images. For example, if the rm command is used to remove one of these images, the soft link will be deleted, but the physical file will not be deleted. Always use the cmdel function to remove images.

    This is a list of available Unix Disk Handling Routines:

    dkcopy.html
    dkcre.html
    dkdel.html
    dkfree.html
    dkmove.html
    dkrspac.html