Get the shell's temporary directory location.

Defaults to  `/psysh` inside the system's temp dir unless explicitly
overridden.

@return string
979202
public function getRuntimeDir()
    {
        if (!isset($this->runtimeDir)) {
            $this->runtimeDir = ConfigPaths::getRuntimeDir();
        }

        if (!\is_dir($this->runtimeDir)) {
            \mkdir($this->runtimeDir, 0700, true);
        }

        return $this->runtimeDir;
    }
205821
public static function getDefaultPath()
    {
        // use static path for all Unix-based systems
        if (DIRECTORY_SEPARATOR !== '\\') {
            return '/etc/hosts';
        }

        // Windows actually stores the path in the registry under
        // \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DataBasePath
        $path = '%SystemRoot%\\system32\drivers\etc\hosts';

        $base = getenv('SystemRoot');
        if ($base === false) {
            $base = 'C:\\Windows';
        }

        return str_replace('%SystemRoot%', $base, $path);
    }
712401
def _getTempSharedDir(self):
        
        tempDir = self.tempFilesDir
        for i in range(self.levels):
            tempDir = os.path.join(tempDir, random.choice(self.validDirs))
            if not os.path.exists(tempDir):
                try:
                    os.mkdir(tempDir)
                except os.error:
                    if not os.path.exists(tempDir): # In the case that a collision occurs and
                        # it is created while we wait then we ignore
                        raise
        return tempDir
664447
private function tempDir()
	{
		$tempPath = tempnam($this->tmp, 'elFinder');
		if (!$tempPath) {
			$this->setError(elFinder::ERROR_CREATING_TEMP_DIR, $this->tmp);
			return false;
		}
		$success = unlink($tempPath);
		if (!$success) {
			$this->setError(elFinder::ERROR_CREATING_TEMP_DIR, $this->tmp);
			return false;
		}
		$success = mkdir($tempPath, 0700, true);
		if (!$success) {
			$this->setError(elFinder::ERROR_CREATING_TEMP_DIR, $this->tmp);
			return false;
		}
		return $tempPath;
	}
121685
public function getRootDir()
    {
        static $dir;
        if (empty($dir)) {
            $rc = new \ReflectionClass(get_class($this));
            $dir = dirname(dirname($rc->getFileName()));
        }
        return $dir;
    }
40408
public function getDirectory()
    {
        $dir = new Directory($this->getDirname());

        $namespaces = explode('\\', $this->getNameSpace());
        array_pop($namespaces);
        $dir->setNamespace(join('\\', $namespaces));

        return $dir;
    }
371712
def temporary_directory():
    
    dir_name = tempfile.mkdtemp()
    yield dir_name
    if os.path.exists(dir_name):
        shutil.rmtree(dir_name)
1088356
protected function getTmpPath()
        {
            $tmpDir = sys_get_temp_dir();

            if (!empty($this->prefix)) {
                $tmpDir .= DIRECTORY_SEPARATOR . $this->prefix;
            }

            $tmpDir .= DIRECTORY_SEPARATOR . uniqid('run-', true);

            return $tmpDir;
        }
623440
def get_temp_directory():
    """"""
    # Supports all platforms supported by tempfile
    directory = os.path.join(gettempdir(), "ttkthemes")
    if not os.path.exists(directory):
        os.makedirs(directory)
    return directory
1106610
public function getCachePath() {
		if ($this->path === null) {
			$this->path = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR);
		}
		
		return $this->path;
	}
182745
public static File getCacheDir ()
    {
        if (_tmpdir == null) {
            String tmpdir = System.getProperty("java.io.tmpdir");
            if (tmpdir == null) {
                log.info("No system defined temp directory. Faking it.");
                tmpdir = System.getProperty("user.home");
            }
            setCacheDir(new File(tmpdir));
        }
        return _tmpdir;
    }
1309290
public function getDirectory() : ?string 
    {
        if ( ! $this->hasDirectory()) {
            $this->setDirectory($this->getDefaultDirectory());
        }
        return $this->directory;
    }
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;
    }
479124
protected function tempdir()
    {
        $tempfile = tempnam(sys_get_temp_dir(), '');
        if (file_exists($tempfile)) {
            unlink($tempfile);
        }
        mkdir($tempfile);
        if (is_dir($tempfile)) {
            return $tempfile;
        }

        return false;
    }
672340
private function getTmpPath(): string
    {
        $tmpDir = sys_get_temp_dir();
        if (!empty($this->prefix)) {
            $tmpDir .= '/' . $this->prefix;
        }
        $tmpDir .= '/' . $this->id;
        return $tmpDir;
    }
1000604
public function tempnam()
  {
    $sysTempDir = $this->_sysGetTempDir();
    do {
      $this->_tempnamCounter++;
      $name = $sysTempDir . "/" . $this->_tempnamCounter;
    } while (file_exists($name));

    return $name;
  }
575155
def tempDir(self):
        
        if self._tempDir is None:
            self._tempDir = self._fileStore.getLocalTempDir()
        return self._tempDir