web: if mkdir fails, show the path in error msg

This commit is contained in:
David Anderson 2017-01-09 11:46:51 -08:00
parent d6ff95d1ec
commit 79fa97cfe3
1 changed files with 3 additions and 1 deletions

View File

@ -29,7 +29,9 @@ function dir_hier_path($filename, $root, $fanout) {
$dir = filename_hash($filename, $fanout);
$dirpath = "$root/$dir";
if (!is_dir($dirpath)) {
mkdir($dirpath);
if (!mkdir($dirpath)) {
echo "failed to mkdir: $dirpath\n";
}
}
return "$dirpath/$filename";
}