private function checkFolder(string $path, string $folder, bool $create = false) : bool
    {
        $retval = false;

        $target = $path . (is_string($folder) && strlen($folder) > 0 ? DIRECTORY_SEPARATOR . $folder : '');
        echo "    ... checking folder $target ...";

        if (is_dir($target)) {
            echo "EXISTS\n";
            $retval = true;
        } elseif ($create) {
            if ($retval = mkdir($target)) {
                echo "CREATED\n";
            } else {
                echo "ERROR\n";
            }
        } else {
            echo "NOT PRESENT\n";
        }

        return $retval;
    }