SA_IsiOpen


 

A file must be created or opened prior to any attempt to process data against it. SA_IsiOpen opens the indicated index key file and the text file associated with it. The text file name is in the header sector of the index file.

SA_FH SA_IsiOpen ( char *IsiName, u32 IsiNameLen, u32 OpenMode );

Parameters:
IsiName
The file name of the ISAM file to open.
IsiNameLen
The length of {IsiName}.
OpenMode
A valid file access mode.

Note the following:

  1. Upon success of the function, the open file handle is returned.

  2. There is no implied close of an open file. If a file is opened and the file handle is used again in a subsequent open or prepare, the first file will remain open for the duration of the program.

  3. Function return codes are as follows:

  4.  

    Value

    Meaning

    +nn

    Success (file handle).

    -nn

    Error as described in Sunaccess Errors

Example 1 - Local file open:

 

if ((fh = SA_IsiOpen("mastf8mr.isi", 12, SA_SHARE)) < 0)

     {

     printf("Open error code = %d", fh );

     exit(1);

     }

Example 2 - Managed file open:

 

if ((fh = SA_IsiOpen("mastf8mr.isi|64.246.11.321", 26, SA_SHARE)) < 0)

     {

     printf("Open error code = %d", fh );

     exit(1);

     }

 

where "64.246.11.321" is the IP number of the Sunbelt Data Manager. Optionally, the user can use a Managed File Descriptor to open the file:

 

if ((fh = SA_IsiOpen("mastf8mr.mfd", 12, SA_SHARE)) < 0)

     {

     printf("Open error code = %d", fh );

     exit(1);

     }

 

The MFD is created using the Sunbelt "makemfd" utility and specifies the location of the server and other parameters.



Sunaccess Reference SA_IsiPrep SA_IsiClose