Delete a directory.

@param string $dirname

@return bool
481989
public function deleteDir($dirname)
    {
        $dirname = rtrim($dirname, '/').'/';

        if (false === $this->has($dirname)) {
            return false;
        }

        $dirname = $this->applyPathPrefix($dirname);

        $this->bucket->object($dirname)->delete();

        return !$this->bucket->object($dirname)->exists();
    }
1325970
public function delete($dn)
	{
		if (!$this->isBound || !$this->isConnected())
		{
			return false;
		}

		return ldap_delete($this->resource, $dn);
	}
774806
public static function cleanDirectory(string $directory): bool
    {
        self::removeDirectory($directory);
        return self::createDirectory($directory);
    }
1297754
public function deleteDir($dirname)
    {
        return (bool) $this->normalizeResponse(
            $this->cosApi->delFolder($this->getBucket(), $dirname)
        );
    }
1231018
public function deleteDir(string $dirname): bool
    {
        $location = $this->applyBasePath($dirname);

        if (! is_dir($location)) {
            throw new DirectoryNotExistsException($dirname);
        }

        $contents = new RecursiveIteratorIterator(
            new RecursiveDirectoryIterator($location, FilesystemIterator::SKIP_DOTS),
            RecursiveIteratorIterator::CHILD_FIRST
        );

        foreach ($contents as $file) {
            if ($file->isReadable()) {
                switch ($file->getType()) {
                    case 'dir':
                        rmdir($file->getRealPath());
                        break;
                    case 'link':
                        unlink($file->getPathname());
                        break;
                    default:
                        unlink($file->getRealPath());
                        break;
                }
            }
        }

        unset($contents);

        return rmdir($location);
    }
898731
public function ensureDirectory($dirname)
    {
        if ( ! empty($dirname) && ! $this->has($dirname)) {
            $this->createDir($dirname, new Config());
        }
    }
555361
public static function delete($filename)
    {
        if (is_string($filename) && file_exists($filename)) {
            unlink($filename);
            return true;
        }

        return false;
    }
203430
public function rmdirr($dirname)
    {
        // Sanity check
        if (!$this->file_exists($dirname)) {
            return false;
        }

        // Simple delete for a file
        if ($this->is_file($dirname) || $this->is_link($dirname)) {
            return $this->unlink($dirname);
        }

        // Loop through the folder
        $dir = $this->dir($dirname);
        while (false !== $entry = $dir->read()) {
            // Skip pointers
            if ($entry == '.' || $entry == '..') {
                continue;
            }
            // Recurse
            $this->rmdirr($dirname . DIRECTORY_SEPARATOR . $entry);
        }

        // Clean up
        $dir->close();
        return $this->rmdir($dirname);
    }
650044
public function deleteDirectories($directory)
    {
        $allDirectories = $this->directories($directory);

        if (! empty($allDirectories)) {
            foreach ($allDirectories as $directoryName) {
                $this->deleteDirectory($directoryName);
            }

            return true;
        }

        return false;
    }
1345694
public static function del($dir, $filter = '')
    {
        $files = new \DirectoryIterator($dir);
        foreach ($files as $file) {
            if ($file->isDot()) {
                continue;
            }
            $filename = $file->getFilename();
            if (!empty($filter) && !\preg_match($filter, $filename)) {
                continue;
            }
            if ($file->isDir()) {
                self::del($dir . DS . $filename);
            } else {
                \unlink($dir . DS . $filename);
            }
        }
        return \rmdir($dir);
    }
899186
public function delete($filename)
    {

        $dirname  = pathinfo($filename, PATHINFO_DIRNAME);
        $basename = pathinfo($filename, PATHINFO_BASENAME);

        $file_name = substr($basename, 0, strrpos($basename, '.'));

        $files = $this->storage->files($dirname);

        foreach ($files as $value) {
            $value_basename = pathinfo($value, PATHINFO_BASENAME);
            $name           = substr($value_basename, 0, strrpos($value_basename, '-'));

            if ($name == $file_name) {
                $this->storage->delete($value);
            }
        }

    }
981460
public function deleteDir($dirname)
    {
        return (bool)$this->normalizeResponse(
            Cosapi::delFolder($this->getBucket(), $dirname)
        );
    }
1158217
public static function emptyDir($dirname) {
    if (is_dir($dirname)) {
      $files = self::getFiles($dirname, '/./', true, true);
      foreach ($files as $file) {
        @unlink($file);
      }
      $dirs = self::getDirectories($dirname, '/./', true, true);
      foreach ($dirs as $dir) {
        @rmdir($dir);
      }
    }
  }
1059571
public function removeFolder( $dirName )
	{
		if( !$this->numFolders )
			return FALSE;
		foreach( $this->folders as $key => $information )
		{
			if( $information['name'] !== $dirName )
				continue;
			$this->numFolders--;
			unset( $this->folders[$key] );
			return TRUE;
		}
	}
631990
public function deleteDir($dirName)
    {
        $location = $this->applyPathPrefix($dirName);
        $lists = $this->listContents($location, true);
        if (!$lists) {
            return false;
        }
        $objectList = [];
        foreach ($lists as $value) {
            $objectList[] = $value['path'];
        }
        $this->ossClient->deleteObjects($this->bucket, $objectList);
        return true;
    }
439874
private function makeActualDirectory($dirname, $mode)
    {
        $listing = glob($this->current_working_dir . '/*', GLOB_ONLYDIR) ?: [];

        $directories = array_map(function ($value) {
            return pathinfo($value, PATHINFO_BASENAME);
        }, $listing);

        // Skip directory creation if it already exists
        if (in_array($dirname, $directories, true)) {
            return true;
        }

        return @mkdir($dirname, $mode);
    }
1000720
protected function doCreateDir($dirname)
	{
		if ($this->hasDirectory($dirname)) {
			return true;
		}

		if ($this->hasFile($dirname)) {
			return false;
		}

		// Make sure all the sub-directories exist.
		if (!$this->doCreateDir(Util::dirname($dirname))) {
			return false;
		}

		$this->storage[$dirname]['type'] = 'dir';

		return true;
	}