General utilities for file manipulation