We now have just one place which writes to the filesystem. Wrap a temporary file allocation API on top of that.