elFinderVolumeFTP::tempDir PHP Method

tempDir() private method

Create writable temporary directory and return path to it.
private tempDir ( ) : string
return string path to the new temporary directory or false in case of error.
    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;
    }