ID: 49727 Updated by: il...@php.net Reported By: ipseno at yahoo dot com -Status: Open +Status: Closed Bug Type: Filesystem function related Operating System: WIN XP SP3 PHP Version: 5.3SVN-2009-09-30 (snap) New Comment:
This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2009-09-30 18:56:16] ipseno at yahoo dot com Description: ------------ fclose is not enough to dereference file Reproduce code: --------------- This WORKED before: .... php code here .... // The file that the transfer should be written to, $fp is open file handle in writing(binary) mode curl_setopt($this->ch, CURLOPT_FILE, $fp); // Store image to file curl_exec($this->ch); // Close /path/temp/image.tmp fclose($fp); // HERE IS A CATCH! rename(/path/temp/image.tmp, /path/temp/image.tmp.png); Expected result: ---------------- To rename a file Actual result: -------------- NOW, it issues error and DOES NOT rename file: Warning: rename(/path/temp/image.tmp, /path/temp/image.tmp.png) [function.rename]: No such file or directory in /path/script.php on line 53536440 FIX: adding unset()! .... php code here .... unset($fp); // HERE IS A CATCH! rename(/path/temp/image.tmp, /path/temp/image.tmp.png); Problem: In 5.2 it worked without unset($fp); code line! ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=49727&edit=1