Stores a list of files with some metadata into an archive



IDs = gd_archivefiles(filepaths, [metadata], [datagroupIDs])



IDs = gd_archivefiles(filepaths, [metadata], [datagroupIDs]) takes a cell array of strings representing filepaths, and archives the files to a file store (specified in the ClientConfig.xml file). A unique identifier (ID) for each archived file is returned in a cell array which can be used to retrieve the files with gd_retrievefiles.


Input Arguments

The function optionally takes a metadata structure or a cell array of metadata structures. The metadata structure specifying some user defined information about the files at can be later queried with gd_query. The optional datagroupIDs is the ID of a datagroup or a cell array of datagroup ID that the files should be added to. A datagroup is used to group together a collection of files, variables and other datagroups, see gd_datagroup and gd_datagroupadd.


For more information about the metadata, see gd_archive.



Archive two files with no user defined metadata, and add them to datagroups dgId1 and dgId2 respectively.


IDs = gd_archivefiles({'C:\file.dat', 'C:\input.txt'},[], {'dgId1', 'dgId2'})


IDs =




Archive two files that share the same user defined metadata, and give user1 and user2 READ access to them. = 'test_design';

m.iterations = 9000; 

m.standard.comment = 'This is a test.';

m.access.users = {'user1','user2'};

gd_archivefiles({'C:\file.dat', 'C:\input.txt'}, m);


Archive two files with own user defined metadata (e.g. m1 and m2 contain the metadata for file.dat and config.txt respectively), and give users 'tim', 'sam', and group 'genie' READ access. Add these two files into the datagroup 'dg3'. = 'test_design_1';

m1.iterations = 9000; 

m1.standard.comment = 'Comment about file.dat.';

m1.access.users = {'tom','sam'}; = 'test_design_2';

m2.iterations = 5000; 

m2.standard.comment = 'Comment about input.txt.';

m2.access.groups = {'genie'};


gd_archivefiles({'C:\file.dat', 'C:\input.txt'}, {m1, m2}, 'dgId3');



A valid proxy certificate is required to archive a file (see gd_createproxy from the Geodise Compute Toolbox).


You must have access to the host machine the files will be archived on. Your certificate subject must be added to the gridmap file on the host and to the authorisation database.


See also

gd_archive, gd_addusers, gd_retrieve, gd_retrievefiles, gd_query, gd_datagroup, gd_datagroupadd, gd_createproxy




Copyright © 2007, The Geodise Project, University of Southampton