+ // Create the shared folder directory if necessary.
+ if(FALSE === file_exists($pathName)) {
+ // Create the directory. Note, the function seems to have a bug
+ // when using the mask parameter. E.g. octdec("777") does not
+ // create the correct permissions as expected, thus change the
+ // mode using chmod.
+ if(FALSE === mkdir($pathName, 0700, TRUE)) {
+ throw new OMVException(OMVErrorMsg::E_MISC_FAILURE,
+ sprintf("Failed to create the directory '%s'", $pathName));
+ }
+ // Change the directory mode.
+ if(FALSE === chmod($pathName, octdec($object['mode']))) {
+ throw new OMVException(OMVErrorMsg::E_MISC_FAILURE,
+ sprintf("Failed to set file mode to '%s' for '%s'",
+ $object['mode'], $pathName));
+ }
+ }
+