------- Comment #4 from ktietz at gcc dot gnu dot org 2010-04-22 07:42 ------- (In reply to comment #3) > My feeling is that, e.g., on Windows this won't work; I do not know whether > before the environment variables "GFORTRAN_TMPDIR", "TMP" and "TEMP" are used > or not, but "/tmp" does exist on many Windows systems. > > Kai, what's the best way to find out the temporary directory under Windows > (MinGW/MinGW64/Cygwin)? And, do you see something obviously wrong with the > code > in comment 1 > (alias > http://gcc.gnu.org/git/?p=gcc.git;a=blob;f=libgfortran/io/unix.c;hb=HEAD#l868 > ) >
I would use here the platform API "GetTempPath". This seems to be the best solution here. In general TEMP and/or TMP are defined in environment, but they need to be there defined. So This functions should do the proper thing for win32 targets (beside cygwin, as here /tmp/ is of course valid). Kai -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43844