SA_AamOpen
A file must be created or opened prior to any attempt to process data against it. SA_AamOpen opens the indicated aamdex file and the text file associated with it.
SA_FH SA_AamOpen ( char *AamName, u32 AamNameLen, char DontCare, u32 OpenMode);
Note the following:
Upon success of the function, the open file handle is returned.
The text file name is retrieved from the header sector of the AAM file.
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.
{DontCare}, if specified, re-defines the universal matching character for searches. A null character or null string pointer leaves the universal matching character as set by SA_AamPrep or as default ("?").
Function return codes are as follows:
|
Value |
Meaning |
|
+nn |
Success (file handle). |
|
-nn |
Error as described in Sunaccess Errors |
Example 1 - Local file open:
if ((fh = SA_AamOpen("mastf8mr.aam",
12, '?', SA_SHARE)) < 0)
{
printf("Open error code = %d", fh );
exit(1);
}
Example 2 - Managed file open:
if ((fh = SA_AamOpen("mastf8mr.aam|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_AamOpen("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.
![]() |