COS_GET_OBJECT_DATA_AS_FILE
Syntax
string_val = COS_GET_OBJECT_DATA_AS_FILE ( cos_id );
- Input arguments
-
string cos_id COS ID of the object whose data to extract.
Return Values
- Success:
-
string file The name of file that contains the configuration object data.
- Failure:
-
int -1 Object not found. int -2 File could not be created.
Description
This function puts the data part of a configuration object into a temporary file and returns the name, so that a script can read the data using formatted reads. After the reading, the temporary file should be deleted by the caller script.
Example
Example of using the function (error checks have been removed from the code):
Copy
cos_id = COS_SELECT_OBJECT(MMT_COST_STRC_GDL);
COS_READ_OBJECT(cos_id);
file = COS_GET_OBJECT_DATA_AS_FILE (cos_id);
h = F_OPEN_FILE(file, "r");
i = -12345;
r = F_READ_INT(h, i);
r = F_READ_INT(h, i);
...
...
etc.
F_CLOSE_FILE(h);
F_DELETE_FILE(file);