|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
toma Smarty Regular
Joined: 25 Apr 2003 Posts: 62
|
Posted: Mon Nov 23, 2009 9:47 pm Post subject: unlink fails |
|
|
Two warnings my site has spit out on ß4
WARNING [2] unlink(/public/projects/etree/projects/dev.etreedb.org/cache/1498912485.freetext.tpl.php) [function.unlink]: No such file or directory
Warning on line 39 in file /public/projects/etree/projects/dev.etreedb.org/Smarty3Dev/distribution/libs/sysplugins/smarty_internal_write_file.php
WARNING [2] unlink(/public/projects/etree/projects/dev.etreedb.org/cache/1502255914.index.ihtml.php) [function.unlink]: No such file or directory
Warning on line 39 in file /public/projects/etree/projects/dev.etreedb.org/Smarty3Dev/distribution/libs/sysplugins/smarty_internal_write_file.php
The smarty code:
// remove original file
if (file_exists($_filepath))
unlink($_filepath);
It looks like one cache is being written after another deletes it. I get about 200-300k hits / day. |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon Nov 23, 2009 10:11 pm Post subject: |
|
|
You are entering a race condition, the item is removed between the checks. We could use @unlink() as a means to suppress the error in PHP.
Can you alter unlink() to @unlink() and see if that masks the warning? |
|
Back to top |
|
toma Smarty Regular
Joined: 25 Apr 2003 Posts: 62
|
Posted: Mon Nov 23, 2009 10:17 pm Post subject: |
|
|
I've changed the code. I'll report back in a few days whether I see any more warnings. |
|
Back to top |
|
angelndevils Smarty n00b
Joined: 21 Oct 2010 Posts: 1
|
Posted: Thu Oct 21, 2010 7:12 am Post subject: |
|
|
I have same problem. Everything is ok until I reinstall apache and php... I don't know what happening? |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|