public function ensureDir($dir_name)
    {
        if (is_dir($dir_name) || @mkdir($dir_name)) {
            return true;
        } else {
            $parent_dir = dirname($dir_name);

            // Terminal case; there is no parent directory to create.
            if ($parent_dir == $dir_name) {
                return true;
            }

            return (Auth_OpenID::ensureDir($parent_dir) && @mkdir($dir_name));
        }
    }