The recorder can attach files to ADTFDAT recordings based on a XML configuration file. The XSD describing the format can be found at
doc/xsd/xmlbinding/adtfxsdattachments/adtfxsdattachments.xsd
Let's take a look at the following example:
By specifing this file in the Property 'attachment_configuration_file' of a recorder, these files will be attached to each recording. Please see ADTFDAT File Recorder for further properties regarding attached files handling.
There are multiple ways to extract files from ADTFDAT recordings.
The local interface ExtractAttachedFiles and the RPC interface ExtractAttachedFiles allows a user to extract files at any given time.
If there is an ADTFDAT recording specified in the 'extract_attached_files_from' property of the Playback Service, then the files will be extracted during service initialization.
To access extracted files you can use the tags via macros. The Playback Service will define a macro in the form of $(AF:<tag_name>)
for each tag. If a tag is referenced by multiple files the macro will resolve to a semi-colon seperated list. This way you can use these macros in your Properties (all kinds of Properties, but especially for Properties of Type cFilename, cFilepath, cFilenameList, and cFilepathList.
Using our example above the following macros would be available
If the Property 'cache_attachment_archive' of the recorder is set to false, then the recorder will read the configuration and attach the files each time a recording is closed. This happens after the kernel signal PreFileClosed (see adtf::services::ant::IRecordingSignal) has been processed by all recipients. This way you can create files that should be attached or even (re-)create the configuration during handling of this signal.
Mind that all this happens asynchronously to the Stop call. So use the GetTimeRange method to choose data to your liking.
The files are stored as a tar.gz archive within the "attached_files" extension of an ADTFDAT file. So the files can easily be extracted with the help of the adtf_dattool tool:
adtf_dattool --export recording.adtfdat --extension attached_files --output attached_files.tar.gz
and then open the archive with your preferred archiver.