File Open - Access Module

Teradata Tools and Utilities Access Modules Programmer Guide

Product
Access Module
Release Number
15.10
Language
English (United States)
Last Update
2018-10-07
dita:id
B035-2424
lifecycle
previous
Product Category
Teradata Tools and Utilities

The File Open function opens a file for subsequent read and write operations.

The term file refers to a data source or destination on any sort of data storage device (such as magnetic tape, disk, CD‑ROM, or another database) that an Access Module supports. The terms read and write refer to data moving from (read) and to (write) the data source/destination. The structure follows:

typedef struct _pmiOpen
{
 char         EyeCatcher[pmiMAX_EC_LEN];  /* Struct eyecatcher string */
 pmUInt32     StructLength;               /* Length of this structure */
 void        *PIData;         /* Access  module Internal Data Pointer */
 pmOpenMode_t OpenMode;                  /* provided to Access Module */
 pmUInt16     BlkHeaderLen;               /* defined by Access Module */
 pmUInt32     BlkSize;                    /* defined by Access Module */
                                                /* File Internal Data */
 void        *FIData;              /*(returned/used by Access Module) */
                      /* File (data stream) supplied to Access Module */
 pmUInt16     FileNameL;                               /* Name length */
  har         FileName[pmiMAX_DDNAME_LEN+1];                  /* Name */
} pmiOpen_t;
 

where:

 

Parameter

Field

Description

EyeCatcher

input

Structure description string, such as pmOpenParms.

StructLength

input

Total structure length, including the EyeCatcher string.

PIData

input

Value provided by the Access Module in response to a previous initialization request call. This value identifies the instance of the Access Module opening the file.

OpenMode

input

Indicates the intended use of the file to be opened. The following values are supported.

  • pmOpenModeR opens the file for readonly access.
  • pmOpenModeW opens the file for writeonly access.
  • pmOpenModeRW opens the file for writeonly access, appending to the end of the file.
  • BlkHeaderLen

    output

    Number of devicedependent bytes that prefix the user data in each block.

    BlkSize

    output

    Size, in bytes, of the data blocks to be either read from or written to the file.

    FIData

    output

    Handle/pointer to internal Access Module data. There are no restrictions on the FIData value, and the assigned value will be returned in a subsequent call to the Access Module.

    FileNameL

    input

    Length of FileName parameter.

    FileName

    input

    Name of the file to be opened.