guys correct me if I'm wrong
Tackleberry,
The file handle function commands in PHP first have to be based off the actuall path. Such as fopen, you have to use the real file name, but once you have identified it you should be able to use (in your case) $file. i.e fclose($file)
I read this somewhere in the documentation somewhere I'm pretty sure but I could be wrong 🙂
Regards,
Taylor