private function getTempDir($volumeTempPath = null) {
		$testDirs = array();
		if (function_exists('sys_get_temp_dir')) {
			$testDirs[] = sys_get_temp_dir();
		}
		if ($volumeTempPath) {
			$testDirs[] = rtrim(realpath($volumeTempPath), DIRECTORY_SEPARATOR);
		}
		$tempDir = '';
		$test = DIRECTORY_SEPARATOR . microtime(true);
		foreach($testDirs as $testDir) {
			if (!$testDir) continue;
			$testFile = $testDir.$test;
			if (touch($testFile)) {
				unlink($testFile);
				$tempDir = $testDir;
				$gc = time() - 3600;
				foreach(glob($tempDir . '/ELF*') as $cf) {
					if (filemtime($cf) < $gc) {
						@unlink($cf);
					}
				}
				break;
			}
		}
		return $tempDir;
	}