API: Ability to append to existing resource
|Target version:||Candidate for next minor release|
This is only relevant to external APIs for use of the special gmt read|write modules: It should be possible to append more resources to an existing dataset (for those data types that allow this). E.g., in MATLAB:
D = gmt ('read -Td file.txt'); % Read in a data set % Do something with this, then needing to extend it D = gmt ('read -TD another.txt'); % Append to D since passing -TD
The mex part simply needs to realize that the l.h.s. pointer exists already and that uppercase -TD was given (which implies append). The external API should check that the operation is allowed (the GMT API will complain if no checking is done).
Similarly, write needs append mode as well:
gmt ('write -Td output.txt', D); % Write D to file output.txt gmt (write -TD output,txt, D2); % Append more data to output.txt
Append mode should be able to work for datasets, textsets, CPT, and PS, but not grids and images. The coding for this will mostly take place in the GMT_copy function.