Validate that the storage directory exists. If it does not, create it.

@return bool
327122
public function validateStoragePath()
    {
        if (!$this->files->exists($this->storage)) {
            return $this->files->makeDirectory($this->storage);
        }

        return true;
    }
23825
public function beforeValidate()
    {
        $validation = parent::beforeValidate();
        return $validation && PropertyStorageHelper::storageById($this->storage_id)->beforePropertyValidate($this);
    }
1300319
public function blobExists()
    {
        if ($this->blob->path . '' === '') {
            return true;
        }

        return $this->storage->exists($this->blob->path);
    }
631318
public function valid() {
        if (!isset($this->za)) {
            return false;
        }

        // Skip over unwanted system files (get_info will return false).
        while (!$this->get_info($this->pos) && $this->pos < $this->za->numFiles) {
            $this->next();
        }

        // No files left - we're at the end.
        if ($this->pos >= $this->za->numFiles) {
            return false;
        }

        return true;
    }
1278940
public function hasDirectory()
    {
        if (!is_dir($this->getPath()) && !mkdir($this->getPath(), 0775, true)) {
            throw new InvalidCacheDirectoryException('Unable to create cache directory ');
        } elseif (
            !is_readable($this->getPath()) ||
            !is_writable($this->getPath())
        ) {
            if (!chmod($this->getPath(), 0775)) {
                throw new InvalidCacheDirectoryException(
                    'Cache Path Error '.$this->getPath().' directory must be writable'
                );
            }
        }

        return true;
    }
801730
def ensure_dir_exists(directory):
    """"""
    if directory and not os.path.exists(directory):
        os.makedirs(directory)
392178
public function exists(): bool
    {
        $realPath = \realpath($this->path);
        if (false === $realPath) {
            return false;
        }
        $this->path = $realPath;
        $this->assertCorrectType();

        return true;
    }
636381
public function create()
    {
        $installedLogFile = storage_path('installed');

        $dateStamp = date("Y/m/d h:i:sa");

        if (!file_exists($installedLogFile))
        {
            $message = trans('installer_messages.installed.success_log_message') . $dateStamp . "\n";

            file_put_contents($installedLogFile, $message);

        } else {
            $message = trans('installer_messages.updater.log.success_message') . $dateStamp;

            file_put_contents($installedLogFile, $message.PHP_EOL , FILE_APPEND | LOCK_EX);
        }

        return $message;
    }
447007
def check_create_folder(filename):
    """"""
    os.makedirs(os.path.dirname(filename), exist_ok=True)
573988
def ensure_dir_exists(verify_dir):
    """"""
    if not os.path.exists(verify_dir):
        # Doesn't exist create dir
        os.makedirs(verify_dir)
    else:
        # Exists
        if not os.path.isdir(verify_dir):
            # Not a dir, raise an exception
            raise ValueError("{} is not a directory".format(verify_dir))
1223281
public function valid()
    {
        $key = key($this->storage);

        if ($key === false || $key === null) {
            return false;
        }

        return isset($this->storage[$key]);
    }
40427
public function createChunkDir()
    {
        $directoryName = date('Y/m/d/H/i/', time());
        $dir = $this->getDir() . $directoryName;

        if (!$this->filesystem->exists($dir)) {
            $this->filesystem->mkdir($dir, 0755);
        }

        return $directoryName;
    }
492198
public function check(): bool
    {
        $path = \app()->storagePath();

        $this->description = Str::replace($this->description, \compact('path'));

        return $this->checkPathIsWritable($path);
    }
1047852
public function createavatardir(){
		$avatardir=$this->getavatardir();
		if(empty($avatardir)){
			return false;
			}
		if(!is_dir($avatardir)){
			mkdir($avatardir,0777, true);
			}
		return true;
		}
1005141
private function checkDir() : void
    {
        $dir = dirname($this->path);
        if (!is_dir($dir)) {
            if (file_exists($dir)) {
                throw new \RuntimeException($dir . ' exists and is not a directory.');
            }
            if (!@mkdir($dir, 0755, true)) {
                throw new \RuntimeException($dir . ' does not exist and could not be created.');
            }
        }
    }
86928
public function upload()
    {
      if ($this->error !== '') {
        return false;
      }

      $isValid = $this->contraintsValidator();

      $isSuccess = $isValid && $this->isSaved($this->_files['tmp_name'], $this->getFullPath());

      return $isSuccess ? $this : false;
    }
746424
public function validate(): bool
    {
        $valid = true;
        $this->_errors = [];
        foreach ($this->_paths as $key => $path) {
            if ($path === null) {
                continue;
            }
            if (!$path->validate()) {
                $valid = false;
            }
            if (strpos($key, '/') !== 0) {
                $this->_errors[] = "Path must begin with /: $key";
            }
        }
        return $valid && empty($this->_errors);
    }