From: Christian Weiske Date: Thu, 16 Aug 2012 20:50:25 +0000 (+0200) Subject: check if dir can be created X-Git-Tag: v0.1.0~17 X-Git-Url: https://git.cweiske.de/surrogator.git/commitdiff_plain/c083f00a1813729162aca77fcc72642c5b7eb6b0 check if dir can be created --- diff --git a/surrogator.php b/surrogator.php index 460cfaa..6270cdc 100755 --- a/surrogator.php +++ b/surrogator.php @@ -85,7 +85,10 @@ if (!isset($logLevel)) { if (!is_dir($varDir . '/square')) { log('creating square dir: ' . $varDir . '/square'); - mkdir($varDir . '/square', 0755, true); + if (!mkdir($varDir . '/square', 0755, true)) { + logErr('cannot create square dir'); + exit(5); + } } log('sizes: ' . implode(', ', $sizes), 2); foreach ($sizes as $size) {