Abstract out file operations.