Transactional file input and output stream