Problem locating GPTEMP folder


A GEMPACK windows program will often need to create various temporary files. The program has to locate a folder in which to create these files.

Normally the program will locate the temporary folder (often C:\TEMP) and create beneath this a folder named GPTEMP, then create below that a folder named after the program (say, ViewSOL). The temporary file would be stored in this bottom level folder, and so might be named:

C:\TEMP\GPTEMP\ViewSOL\temp.sol

The actual location of the temporary folder is defined by your system: it should be stored in the environment variable TMP (or TEMP).

Problems may arise if:

(i) you have no temporary folder.

(ii) you are not allowed to create or modify files in the temporary folder.

(iii) the full pathname of a temporary file is very long, or contains spaces or Asian characters.

To circumvent such problems you can define an environment variable GPTEMP The value of this variable will be used instead of the normal temporary folder. Suppose you set the environment variable GPTEMP to C:\junk. Then a temporary file might be named:

C:\junk\GPTEMP\ViewSOL\temp.sol

The program will create the necessary folders if they do not already exist.

If the program cannot locate a suitable temporary folder, there will be an error. The error message may contain a log showing the success or otherwise of different stages in the process of finding or creating directories, and testing whether it is possible to create files in those directories. On some programs, the top-level menu command Help..About..Diagnostics will give further relevant information.

Technical Note: the actual sequence of tests that the program goes through is:

(1) See if environment variable GPTEMP is defined. If not, go to (5).

(2) Suppose environment variable is set to c:\whatever. Attempt to create folder c:\whatever\GPTEMP\progname. If unsuccessful, go to (5).

(3) Attempt to create, then delete, a file c:\whatever\GPTEMP\progname\testfile.xxx. If unsuccessful, go to (5).

(4) Exit successfully: c:\whatever\GPTEMP\progname is the folder for temporary files.

(5) Try steps (2) and (3) again with environment variable TMP (if set).

(6) Try steps (2) and (3) again with environment variable TEMP (if set).

(7) Try steps (2) and (3) again using the Windows directory.

(8) If still unsuccessful, fail with error message.

See also:

Problem locating GPTEMP folder

Setting the GPTEMP or GPKEEP Environment Variable



URL of this topic: www.copsmodels.com/webhelp/tabmate/hc_tempdir.htm

Link to full GEMPACK Manual

Link to GEMPACK homepage