I'm not really sure why the file needs to be written to disk. Care to explain what your reasoning is?