Welcome Guest, Not a member yet? Register   Sign In
unlink and chmod() warnings in is_really_writable() for >100 connections per second
#1

[eluser]Unknown[/eluser]
Sometimes We have unlink or chmode warnings like
unlink(/var/www/system/cache/98dce83da57b0395e163467c9dae521b) in backend width >100 connections per second.

Probably it is colling md5(rand(1,100)Wink.

Disabling checking is_really_writable() resolve this problem.
Add to config/config.php
$config[‘is_realy_writebale_enable’] = false;

Code:
function is_really_writable($file)
{
    if (!config_item('is_realy_writebale_enable'))
        return true;
    if (is_dir($file))
    {
        $file = rtrim($file, '/').'/'.md5(rand(1,100));
        
        if (($fp = @fopen($file, 'ab')) === FALSE)
        {
            return FALSE;
        }
        
        fclose($fp);
        @chmod($file, 0777);
        @unlink($file);
        return TRUE;
    }
    elseif (($fp = @fopen($file, 'ab')) === FALSE)
    {
        return FALSE;
    }

    fclose($fp);
    return TRUE;
}

but isn't good idea to edit core code Sad
helpful suggestion?

http://codeigniter.com/bug_tracker/bug/5511/
#2

[eluser]adamp1[/eluser]
I have just come across this also. Its fine when its on a page but this was a devil of a bug to find when it was being called behind the scenes.

Mine just failed if I kept hitting refresh enough, every so often it fell over.




Theme © iAndrew 2016 - Forum software by © MyBB