Retrieve data from one or more XPA servers and write the results to a file.
XPAGetToFile( XPA_Type xpaHdl, String_Type dest, String_Type cmd )
XPAGetToFile( XPA_Type xpaHdl, String_Type dest, String_Type cmd, fp )
XPAGetToFile( XPA_Type xpaHdl, String_Type dest, String_Type cmd, fp,
Integer_Type max_rec )
XPAGetToFile( XPA_Type xpaHdl, String_Type dest, String_Type cmd, fp,
Integer_Type max_rec, String_Type mode )
fp can be one of String_Type, File_Type, or FD_Type
Return values: (Array_Type names, Array_Type messages)
The XPAGetToFile() function is similar to XPAGet() except that
the returned data is stored in a file rather than as
a S-Lang variable.
This can be useful if a large amount of binary data is
returned, in which case converting to a string format - as done by
XPAGet() - is not very useful.
The XPAGetB() function may also be of use in this situation.
The file handle to which the data is to be written is
given by the fp variable. The default value (i.e. when it is
not supplied) is to use stdout. If the argument is given then
it can either be a string (in which case it represents the
name of the file that will be created), a File_Type
variable - as created by fopen() and popen() - or
a FD_Type varible - as created by open().
The max_rec parameter allows you to limit the number of servers
that are contacted, and the mode parameter is currently
unused.
The return values contain the name and message sent back by each server that processed the command. The length of either array gives the number of servers contacted.
The return value of XPAGetToFile() has changed in CIAO 3.2. See the "Backwards Compatability" section below for a way of loading the module so that the old behavior is retained. The routine no longer returns an integer but two arrays.
The old behavior can be retained by declaring the variable in the Global namespace prior to the first loading of the module. As an example, after:
if (0 != _featurep("xpa"))
error("The XPA module has already been loaded");
public variable _CIAO3_XPA_COMPAT_;
require("xpa");
then the CIAO 3.1 versions of the commands will be used. The first statement, fearuting the _featurep() function, is not necessary, but added as a precaution to check that the XPA module has not previously been loaded.
|