Hi,
I download a file with cURL using option CURLOPT_FILE and then try to rename the downloaded file, for example, from "1.txt" to "2.txt". It fails to rename the file.
PHP throws an error:
"Warning: rename(E:\.../test/1.txt,E:\.../test/2.txt) [function.rename]: No such file or directory in E:\.../test\lib\CURL\Download.php on line 51"
After that I run just one-line-script:
<?php rename("E:\.../test/1.txt","E:\.../test/2.txt");
and renaming succeeds.
Why does it work now? The same renaming operation.
Some other thing:
Windows OS
File "1.txt" indeed exists
I use absolute path when renaming
before renaming i close file handle used by cURL with fclose()
What is wrong? How can I rename the downloaded file in the first script without an error?