pauleau / timthumb

Automatically exported from code.google.com/p/timthumb
0 stars 0 forks source link

Can not rename on windows hosting #423

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. using the script on windows hosting

What is the expected output? What do you see instead?
Can not find the cache image. But generated many tmp files.

What version of the product are you using? On what operating system?

Please provide any additional information below.
I debugged and figured out that the windows hosting I'm using does not allow 
rename file. So I made an around way. In case can not rename the file, I create 
new file and drop old one. like below:
find the line: rename($tempfile4, $this->cachefile);
change it to:
            if(!rename($tempfile4, $this->cachefile))
            {
                //test
                $fp = fopen($tempfile4,'r',0,$context);
                file_put_contents($this->cachefile, $fp, FILE_APPEND);
                fclose($fp);
                @unlink($tempfile4);
                //end test
            }

Original issue reported on code.google.com by DamnedDe...@gmail.com on 25 Jan 2013 at 11:04