diff --git a/MD_STD.php b/MD_STD.php index 8123bba..5776ecb 100644 --- a/MD_STD.php +++ b/MD_STD.php @@ -64,6 +64,10 @@ final class MD_STD { */ public static function mkdir(string $pathname, int $mode = 0775, bool $recursive = false):void { + // One reason, to throw an error, is that the folder already exists. + if (\is_dir($pathname)) { + return; + } if (\mkdir($pathname, $mode, $recursive) === false) { throw new Exception("Failed to create directory: $pathname"); }