If a file does not yet exist, you can create one with the touch() function.
<? touch("myfile.txt"); ?>