generic utility for working with archives