protected function writeAndRelease($handle, $content, $rewrite = false)
    {
        $rewrite && rewind($handle) && ftruncate($handle, 0);
        $result = fwrite($handle, $content);
        flock($handle, LOCK_UN);
        fclose($handle);
        return (bool) $result;
    }