Get/set the directory name.
@return string
511475
public function dirName($dirName = null)
    {
        if (func_num_args() > 0) {
            $parts = pathinfo($this->_name);
            $this->_name = "{$dirName}/{$parts['basename']}";
            return $this;
        }
        return pathinfo($this->_name, PATHINFO_DIRNAME);
    }
997041
public function getTargetDirectory(): string
    {
        $directoryName = $this->getRootRelatedPath($this->getFactorySpecificConfig()['directory']);

        $this->assertDirectoryIsWriteable($directoryName);

        return $directoryName;
    }
206090
protected function getStoragePath()
    {
        if ($override = $this->input->getOption('path')) {
            return $override;
        }
        $config = $this->getConfig();

        return getcwd().'/'.$config->path;
    }
630688
public static function getDirPath()
    {
        $dir = Composer::getComposerVendorDir().'/config';
        self::$dirPath = self::$dirPath === null ? $dir : self::$dirPath;
        self::$dirPath = str_replace('\\', '/', self::$dirPath);
        return self::$dirPath;
    }
1311726
protected function _dirname($path) {
	
		$newpath =  preg_replace("/\/$/", "", $path);
		$dn = substr($path, 0, strrpos($newpath, '/')) ;
		
		if (substr($dn, 0, 1) != '/') {
		 $dn = "/$dn";
		}
		
		return $dn;
	}
1135034
protected function getDirectoryPrettyName()
    {
        $pathName = $this->normalizePath($this->file->getPathname());
        
        // If the post is inside a child directory of the _blog directory then
        // we deal with it like regular site files and generate a nested
        // directories based post path with exact file name.
        if ($this->isInsideBlogDirectory($pathName)) {
            return str_replace('/_blog/', '/', parent::getDirectoryPrettyName());
        }

        $fileBaseName = $this->getFileName();

        $fileRelativePath = $this->getBlogPostSlug($fileBaseName);

        return KATANA_PUBLIC_DIR."/$fileRelativePath";
    }
249516
public function name($name = null)
    {
        if (func_num_args() > 0) {
            $this->_name = str_replace(DIRECTORY_SEPARATOR, '/', $name);
        }
        return $this->_name;
    }
425444
public function getAssetsFolderDirName()
    {
        if ($this->owner->getField('AssetsFolderID') != 0) {
            $dirObj = $this->owner->AssetsFolder();
            $dirName = str_replace('assets/', '', $dirObj->Filename);

            return $dirName;
        }
    }
965045
protected function getTraitDirectory()
    {
        if($config = $this->configFileMissing()) {
            return $this->error($config);
        }

        return 'app/' . rtrim($this->getConfigTraitDirectory(), '/\\') . '/';
    }
923501
private function getDirectoryPath()
    {
        $path = $this->config['directory'];

        // Create directory if not exists
        if (!is_dir($path)) {
            mkdir($path, 0755, true);
        }

        return $path . DIRECTORY_SEPARATOR;
    }
577758
public function dirname()
	{
		if (! is_null($this->url) && $this->path->isEmpty() && ! $this->url->host->isEmpty()) {
			return '/';
		}
		return $this->path->dirname();
	}
219351
public function getFilename()
    {
        if ($this->isDirty && $this->filename) {
            return $this->filename;
        }

        if ($this->mongoGridFSFile instanceof \MongoGridFSFile && $filename = $this->mongoGridFSFile->getFilename()) {
            return $filename;
        }

        return $this->filename;
    }
478838
public static function cacheDirectory()
    {
        $ini = eZINI::instance();
        $cacheDir = $ini->variable( 'FileSettings', 'CacheDir' );

        if ( $cacheDir[0] == "/" )
        {
            return eZDir::path( array( $cacheDir ) );
        }
        else
        {
            return eZDir::path( array( self::varDirectory(), $cacheDir ) );
        }
    }
414726
public function getDir()
    {
        if ($this->dir === null) {
            $rc = new \ReflectionClass($this);
            $this->dir = dirname($rc->getFileName());
        }
        return $this->dir;
    }
471863
public function pwd()
    {
        if ($this->path === null) {
            $dir = $this->Folder->pwd();
            if (is_dir($dir)) {
                $this->path = $this->Folder->slashTerm($dir) . $this->name;
            }
        }

        return $this->path;
    }
1363662
public function getDirMode()
    {
        $dirMode = $this->get('dir-mode', 0777);
        $dirMode = is_string($dirMode) ? octdec($dirMode) : $dirMode;

        return $dirMode;
    }
862586
protected function setThemeDirectory()
    {
        $pos = strrpos($this->dirPath, DIRECTORY_SEPARATOR);

        $this->directory = substr($this->dirPath, $pos + 1);
    }