Gets a path to a temporary directory.

@throws Rah_Eien_Exception
358201
protected function tmpDirectory()
    {
        $this->tmpFile();
        unlink($this->temp);
        $this->temp .= '.d';

        if (mkdir($this->temp) === false)
        {
            throw new Rah_Eien_Exception('Unable to create a temporary directory, check the configured tmp directory.');
        }
    }
742229
public function getDataFixturesDirectoryPath(): ?string
    {
        $path = $this->getPath();

        if (empty($path)) {
            return null;
        }

        return Miscellaneous::concatenatePaths([
            $path,
            static::PATH_DATA_FIXTURES,
        ]);
    }
348878
protected function getTemporaryDirectory()
    {
        $result = $this->temporaryDirectory;
        if ($result === '') {
            $fileHelper = $this->app->make('helper/file');
            $temporaryDirectory = (string) $fileHelper->getTemporaryDirectory();
            if ($temporaryDirectory === '' || !$this->filesystem->isDirectory($temporaryDirectory)) {
                throw new UserMessageException(t('Unable to determine the temporary directory.'));
            }
            $this->temporaryDirectory = $temporaryDirectory;
        }

        return $this->temporaryDirectory;
    }
1247889
public function findTempSafeInstallPath($sInstallPath)
	{
		try
		{
			$sTemp = $this->appendTempExtension($sInstallPath);

			while(file_exists($sTemp))
			{
				$sTemp = $this->appendTempExtension($sTemp);
			}
		}
		catch(Exception $e)
		{
			throw new Exception("No available temp file found for: $sInstallPath", 0, $e);
		}

		return $sTemp;
	}
187577
protected static function tempDirectory()
    {
        $tempDir = eZSys::varDirectory() . '/webdav/tmp';
        if ( !file_exists( $tempDir ) )
        {
            eZDir::mkdir( $tempDir, eZDir::directoryPermission(), true );
        }
        return $tempDir;
    }
502193
public static function getTmpDir()
    {
        if ( self::$tmpDir === null )
        {
            self::$tmpDir = sys_get_temp_dir();
            if ( substr( self::$tmpDir, strlen( self::$tmpDir ) - 1 ) !== DIRECTORY_SEPARATOR )
            {
                self::$tmpDir = self::$tmpDir . DIRECTORY_SEPARATOR;
            }
        }
        return self::$tmpDir;
    }
912493
public function generateTempDirectory(): string
    {
        $path = sys_get_temp_dir() . '/'
            . self::TEMP_FILE_OR_DIRECTORY_PREFIX . bin2hex(random_bytes(self::TEMP_DIRECTORY_NAME_LENGTH));
        
        mkdir($path);
        
        register_shutdown_function(function () use ($path) {
            if (!file_exists($path)) {
                return;
            }

            foreach (new \RecursiveIteratorIterator(
                new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS),
                \RecursiveIteratorIterator::CHILD_FIRST
            ) as $file) {
                if ($file->isDir()) {
                    rmdir($file->getPathname());
                } else {
                    unlink($file->getPathname());
                }
            }
            rmdir($path);
        });
        
        return $path;
    }
102510
private function cacheDirectory(): string
    {
        $cacheDirectory = (string) $this->cacheDirectory;

        if ('' === $cacheDirectory && false === \is_writable($cacheDirectory))
        {
            $cacheDirectory = \sys_get_temp_dir();
        }

        return \rtrim($cacheDirectory, '/');
    }
456022
public static TemporaryFiles get(Application app) {
		TemporaryFiles instance = app.getInstance(TemporaryFiles.class);
		if (instance == null) {
			File dir = null;
			String path = app.getProperty(Application.PROPERTY_TMP_DIRECTORY);
			if (path != null) {
				dir = new File(path);
				if (!dir.exists())
					if (!dir.mkdirs())
						dir = null;
			}
			if (dir == null) {
				path = app.getProperty("java.io.tmpdir");
				if (path != null) {
					dir = new File(path);
					if (!dir.exists())
						if (!dir.mkdirs())
							dir = null;
				}
			}
			instance = new TemporaryFiles(/*app, */dir);
		}
		return instance;
	}
297090
function _getTempDir()
    {
        $tmp_locations = array('/tmp', '/var/tmp', 'c:\WUTemp', 'c:\temp',
                               'c:\windows\temp', 'c:\winnt\temp');

        /* Try PHP's upload_tmp_dir directive. */
        $tmp = ini_get('upload_tmp_dir');

        /* Otherwise, try to determine the TMPDIR environment variable. */
        if (!strlen($tmp)) {
            $tmp = getenv('TMPDIR');
        }

        /* If we still cannot determine a value, then cycle through a list of
         * preset possibilities. */
        while (!strlen($tmp) && count($tmp_locations)) {
            $tmp_check = array_shift($tmp_locations);
            if (@is_dir($tmp_check)) {
                $tmp = $tmp_check;
            }
        }

        /* If it is still empty, we have failed, so return false; otherwise
         * return the directory determined. */
        return strlen($tmp) ? $tmp : false;
    }
1178136
public static function getFile($tmp = true, $name = null)
    {
        return ($tmp ? realpath(sys_get_temp_dir()) : '').'/'.(null === $name ? uniqid() : $name);
    }
44245
protected String getDirectory() {
        //get the default filepath of the permanet storage file
        String directory = storageConfiguration.getDirectory();

        if(directory == null || directory.isEmpty()) {
            directory = System.getProperty("java.io.tmpdir"); //write them to the tmp directory
        }

        return directory;
    }
66463
protected function getTemporaryImageBasePath()
	{
		$basePath = $this->getImageBasePath();

		$temporaryPath = $basePath . '/'. $this->temporaryPath;

		if (!File::exists($temporaryPath)) {
			File::makeDirectory($temporaryPath, 0755, true);
		}

		return $temporaryPath;
	}
874985
public static function getTempDirectory($blnAppendTrailingSlash)
	{
		$path = self::getBaseDirectory(true) . self::DIRECTORY_NAME_TEMP;
		
		if ($blnAppendTrailingSlash)
		{
			$path .= "/";
		}
		return $path;
	}
541117
public function getTempPath(): string
    {
        $path = $this->getRuntimePath() . DIRECTORY_SEPARATOR . 'temp';
        FileHelper::createDirectory($path);
        return $path;
    }
221902
public static File getTempDir() {
        final String str = System.getProperty(TEMP_DIR_KEY);
        if (str == null) {
            throw new IllegalStateException("System property '" + TEMP_DIR_KEY + "' not found!");
        }
        final String tempDirStr = str.trim();
        if (tempDirStr.length() == 0) {
            throw new IllegalStateException("System property '" + TEMP_DIR_KEY + "' is empty!");
        }
        final File dir = new File(tempDirStr);
        try {
            checkValidDir(dir);
        } catch (final IllegalArgumentException ex) {
            throw new IllegalStateException("System property '" + TEMP_DIR_KEY + "' is not valid! [" + ex.getMessage() + "]");
        }
        return dir;
    }
1221720
def temporary(self, path):
    """"""
    if path is None:
      raise ValueError('Can only temporarily establish a build root given a path.')
    prior = self._root_dir
    self._root_dir = path
    try:
      yield
    finally:
      self._root_dir = prior