Feature #825

API: Ability to append to existing resource

Added by Paul almost 2 years ago. Updated almost 2 years ago.

Status:NewStart date:2015-11-28
Priority:NormalDue date:
Assignee:Paul% Done:

0%

Category:-
Target version:Candidate for next minor release
Platform:

Description

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.

History

#1 Updated by Paul almost 2 years ago

  • Tracker changed from Bug to Feature

Also available in: Atom PDF