hwloc-compress-dir may recompress a directory that was previously compressed. All input files that are already in the output directory, either compressed or not, are ignored. New input files are compressed as much as possible as usual.
For each file of the directory, the output filename is the same as the original if not compressed, otherwise its extension is changed to .diff.xml.
Compressed files are based on another non-compressed topology. Its name is stored in the refname topology diff attribute.
The generated output diff files may be used with hwloc-patch just like any file generated by hwloc-diff.
$ hwloc-compress-dir in out
hwloc-compress-dir will return nonzero if any kind of error occurs, such as (but not limited to) failure to parse the command line.