%file.delete();
really
It's not what you think it is. The function to delete a file is
fileDelete("folder/file.txt"). What you're seeing there is the .delete() method that all objects have to remove them from memory. On line one, he creates a FileObject and stores it in %file, which is what he uses to handle opening the file for writing. Once he's done with it, he uses .delete() on the FileObject to clean up the memory since he doesn't need it anymore.