How to get filename from filepointer?

This is really simple, yet I don’t know how to do it:

I’ve opened a file with fopen() and assigned the filepointer to a variable.
Now I want to use unlink() to remove the file, but unlink() requires the filename parameter as a string and not as a filepointer. How do I use the filepointer variable to get its file name? Is there a function for this or should I treat it as an object, for instance
$fp->FileName ?



Use the variable that you used when opening the file. Ie:
$pointer = fopen($filename, “r”); then use $filename not $pointer

Sponsor our Newsletter | Privacy Policy | Terms of Service