Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] FOPEN_WRITE_CREATE
#1

[eluser]nZac[/eluser]
What exactly is FOPEN_WRITE_CREATE. I see it used in the Log class. I have been doing web searches and can't seem to find a definition/explanation for it. Nor can I find it in the PHP manual.


Example from CI:

Code:
// Common.php
function is_really_writable($file)
{    
    // If we're on a Unix server with safe_mode off we call is_writable
    if (DIRECTORY_SEPARATOR == '/' AND @ini_get("safe_mode") == FALSE)
    {
        return is_writable($file);
    }

    // For windows servers and safe_mode "on" installations we'll actually
    // write a file then read it.  Bah...
    if (is_dir($file))
    {
        $file = rtrim($file, '/').'/'.md5(rand(1,100));

        if (($fp = @fopen($file, FOPEN_WRITE_CREATE)) === FALSE)
        {
            return FALSE;
        }

        fclose($fp);
        @chmod($file, DIR_WRITE_MODE);
        @unlink($file);
        return TRUE;
    }
    elseif (($fp = @fopen($file, FOPEN_WRITE_CREATE)) === FALSE)
    {
        return FALSE;
    }

    fclose($fp);
    return TRUE;
}
#2

[eluser]nZac[/eluser]
I am an idiot! I could not find it because it is a CI thing in the constants config file. I am confused then why my search didn't pick it up! Thanks folks!




Theme © iAndrew 2016 - Forum software by © MyBB