Wrap writefile