Gets the temp file.

@exception  IllegalStateException  if already deleted
976474
public File getFile() throws IllegalStateException {
		File f = tempFile;
		if(f==null) throw new IllegalStateException();
		return f;
	}
856589
protected static function getTempDir()
    {
        $name = tempnam(sys_get_temp_dir(), 'tmp');
        unlink($name);
        mkdir($name, 0777, true);
        return $name;
    }
867849
private static function getTemporaryFile() {
        if(is_callable(self::$temp)) {
            $temporaryFile = @call_user_func(self::$temp);
            if(is_string($temporaryFile) && strlen($temporaryFile) && is_writable($temporaryFile)) {
                return $temporaryFile;
            }
        }
        $temporaryDirectory = (is_string(self::$temp) && strlen(self::$temp)) ? self::$temp : sys_get_temp_dir();
        return tempnam($temporaryDirectory, 'Zip');
    }
1262801
private static File getTempMatrixFile() {
        File tmp = null;
        try {
            tmp = File.createTempFile("matlab-sparse-matrix", ".dat");
        } catch (IOException ioe) {
            throw new IOError(ioe);
        }
        tmp.deleteOnExit();
        return tmp;
    }
1065865
def get_temp_file (mode='r', **kwargs):
    """"""
    fd, filename = tempfile.mkstemp(**kwargs)
    return os.fdopen(fd, mode), filename
1209176
public static Action deleteFile(final String path, final String tempDir) {
        if (path == null)
            throw new IllegalArgumentException("The path variable cannot be null");
        if (tempDir == null)
            throw new IllegalArgumentException("The tempDir variable cannot be null");

        final File tempFile = new File(tempDir, Misc.CreateUUID());
        final AtomicBoolean exists = new AtomicBoolean();
        return new Action(
            // Perform:
            new ActionBlock() {
                @Override
                public void execute() throws ActionException {
                    File file = new File(path);
                    if (file.exists()) {
                        if (tempFile == null)
                            throw new ActionException("Cannot perform file deletion as " +
                                    "the temporary file cannot be crated.");

                        boolean success = new File(path).renameTo(tempFile);
                        exists.set(success);
                        if (success)
                            // Mark delete on exit (optional and work on Java only):
                            tempFile.deleteOnExit();
                        else
                            throw new ActionException("Cannot move file " + path +
                                    " to " + tempFile.getAbsolutePath());
                    }
                }
            },
            // Backout:
            new ActionBlock() {
                @Override
                public void execute() throws ActionException {
                    if (exists.get()) {
                        if (!tempFile.renameTo(new File(path)))
                            throw new ActionException("Cannot move file " +
                                    tempFile.getAbsolutePath() + " to " + path);
                    }
                }
            },
            // Cleanup:
            new ActionBlock() {
                @Override
                public void execute() throws ActionException {
                    if (exists.get()) {
                        if (tempFile.isDirectory()) {
                            if (!FileDirUtils.deleteRecursive(tempFile))
                                throw new ActionException("Cannot delete the temporary directory " +
                                        tempFile.getAbsolutePath());
                        } else {
                            if (!tempFile.delete())
                                throw new ActionException("Cannot delete the temporary file " +
                                        tempFile.getAbsolutePath());
                        }
                    }
                }
            });
    }
618072
@Override
    public File getFullFile(String pRelativePath) throws TTIOException, IOException {
        MetaValue value = (MetaValue)mPageReadTrx.getMetaBucket().get(new MetaKey(pRelativePath));

        File file =
            new File(new StringBuilder().append(mTmpDir.getAbsolutePath()).append(File.separator).append(
                pRelativePath).toString());

        if (file.exists()) {
            file.delete();
        }

        file.createNewFile();

        if (value.getData() == emptyFileKey) {
            return file;
        }

        FileData node = (FileData)mPageReadTrx.getData(value.getData());

        OutputSupplier<FileOutputStream> supplier = Files.newOutputStreamSupplier(file, true);

        // Iterating as long as we didn't find the end of the file
        // and writing the bytes to a temporary file.
        do {
            supplier.getOutput().write(node.getVal());
            node = (FileData)mPageReadTrx.getData(node.getDataKey() + 1);
        } while (!node.isEof());

        supplier.getOutput().close();

        return file;
    }
489177
private File getTempFolder(String tempPath) {
        if (tempPath != null) {
            File folder = new File(tempPath);
            if (folder.exists()) {
                return folder;
            }
        }
        return null;
    }
1286233
protected function getUploadTempFile()
    {
        $sUploadDir = $this->getOption('upload.default.dir');
        $sUploadDir = rtrim(trim($sUploadDir), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
        $sUploadDir .= 'tmp' . DIRECTORY_SEPARATOR;
        $sUploadTempFile = $sUploadDir . $this->sTempFile . '.json';
        if(!is_readable($sUploadTempFile))
        {
            throw new \Jaxon\Exception\Error($this->trans('errors.upload.access'));
        }
        return $sUploadTempFile;
    }
1077549
def write_temp_file(content):
        
        f_temp = NamedTemporaryFile(delete=True)
        f_temp.file.write(content)
        f_temp.file.flush()
        return f_temp
178778
private String getPathTemp()
    {
        return UtilFolder.getPathSeparator(File.separator,
                                           getTempDir(loader.get()),
                                           path.replace(separator, File.separator));
    }
1202185
public void forceDelete(File tempFile) {
        try {
            if (tempFile != null && tempFile.exists()) {
                FileUtils.forceDelete(tempFile);
            }
        } catch (Throwable t) {
            t.printStackTrace();
        }
    }
376511
def temp_file_context(raw_dump_path, logger=None):
    """"""
    try:
        yield raw_dump_path
    finally:
        if 'TEMPORARY' in raw_dump_path:
            try:
                os.unlink(raw_dump_path)
            except OSError:
                if logger is None:
                    logger = FakeLogger()
                logger.warning(
                    'unable to delete %s. manual deletion is required.',
                    raw_dump_path,
                    exc_info=True
                )
1130579
static synchronized File tempFile(HttpServerFileUpload upload) {
        String newpostfix;
        String diskFilename = new File(upload.filename()).getName();
        newpostfix = '_' + diskFilename;
        File tmpFile;
        try {
            if (baseDirectory == null) {
                // create a temporary file
                tmpFile = File.createTempFile(prefix, newpostfix);
            } else {
                tmpFile = File.createTempFile(prefix, newpostfix, new File(
                        baseDirectory));
            }
            if (deleteOnExitTemporaryFile) {
                tmpFile.deleteOnExit();
            }
            return tmpFile;
        } catch (IOException e) {
            // Really bad, can't create the tmp file.
            throw new IllegalStateException(e);
        }

    }
202522
public static File createTempFolder(String name) throws Exception {

        File folder = null;
        folder = File.createTempFile(name, "", null);
        folder.delete();
        folder.mkdirs();
        folder.deleteOnExit();
        return folder;
    }
194432
public static String getTempDir() {
        synchronized (FileUtil.class) {
            if (TEMP_DIR == null) {
                // Get the 'java.io.tmpdir' property
                String tmpDir = System.getProperty("java.io.tmpdir");

                if (StringUtil.isEmpty(tmpDir)) {
                    // Stupid fallback...
                    // TODO: Delegate to FileSystem?
                    if (new File("/temp").exists()) {
                        tmpDir = "/temp";  // Windows
                    }
                    else {
                        tmpDir = "/tmp";   // Unix
                    }
                }
                TEMP_DIR = tmpDir;
            }
        }
        return TEMP_DIR;
    }
359540
protected void deleteTempFile() {

        try {
            // switch to the temporary file project
            switchToTempProject();
            // delete the temporary file
            getCms().deleteResource(getParamTempfile(), CmsResource.DELETE_PRESERVE_SIBLINGS);
        } catch (CmsException e) {
            // should usually never happen
            if (LOG.isInfoEnabled()) {
                LOG.info(e);
            }
        } finally {
            try {
                // switch back to the current project
                switchToCurrentProject();
            } catch (CmsException e) {
                // should usually never happen
                if (LOG.isInfoEnabled()) {
                    LOG.info(e);
                }
            }
        }
    }