transactional file input/output