#include <gp.h> SETP gpopen(path, option) char *path; int option; SETP gpcreate(path, option) char *path; int option; SETP gpclone(set, path, option) SETP set; char *path; int option; int gpclose(set) SETP set; int gpsync(set) SETP set; int gpabort(set) SETP set;
The functions described here open, create, and close files stored in TeraScan Common Data Format (TDF).
gpopen opens an existing dataset for read or read/write access, depending on whether option is GP_READ or GP_WRITE, respectively. If the dataset gets variable data from other files, they are opened for read access only.
gpcreate creates a new dataset, available for read/write access. If a file with the same path already exists, and option is GP_CLOBBER, the file is destroyed. If option is GP_NOCLOBBER, the file is not destroyed, and an error occurs.
gpclone creates a new dataset, and copies all dataset attributes from set to the new dataset. option is either GP_CLOBBER or GP_NOCLOBBER, just as with gpcreate.
gpsync causes all dataset related information to be written to disk if the dataset is open for read/write access. If the dataset is open only for read access, nothing happens.
gpclose calls gpsync, then closes the dataset file and all related open files.
gpabort closes the dataset file and all related open files, without calling gpsync. If the dataset is being created, it is removed from the file system.
gpopen, gpcreate and gpclone return dataset pointers if successful. Otherwise they call gperr with the appropriate error code and return NULL.
gpsync, gpclose and gpabort return 0 successful. Otherwise they call gperr with the appropriate error code and return -1.
gpopen, gpcreate and gpclone can encounter almost any of the error codes for the UNIX function open(). In addition, the following error codes may be encountered
Insufficient memory for dataset structures.
An I/O error occurred while reading/writing the dataset.
There is no free space remaining on the file system containing the dataset.
An interrupt occurred while reading/writing the dataset.
Invalid or corrupt dataset.
File is not a TeraScan dataset.
Usually means corrupt or invalid dataset.
Usually means disk full during a variable write.
Invalid set pointer passed by application.
Automatic uncompression failed. See datasets.
include/gp.h, /usr/include/errno.h, lib/libcdf.a
gpatt, gpdim, gperr, gpio, gplink, gpname, gprel, gptype, gpvar, datasets
Last Update: $Date: 2001/12/14 21:22:30 $