rename()
Posted: Thu Nov 23, 2006 7:30 pm
Hi,
I'm trying to rename a temporary file I've created but it doesn't work. Says the file doesn't exist. When I do a file_exists() on the file, it also says it doesn't exist. Yet I can see the file on the server....
Any ideas?
I'm trying to rename a temporary file I've created but it doesn't work. Says the file doesn't exist. When I do a file_exists() on the file, it also says it doesn't exist. Yet I can see the file on the server....
Any ideas?
Code: Select all
//create temp file
$tmp = time().".xml";
$handle = fopen($tmp, "w");
fwrite($handle, "data goes here");
fclose($handle);
//rename temp file
rename($tmp, "data.xml");