Wrap functions to work with files