bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Honoring TMP and TEMP environment variables in tmpdir.c


From: Bruno Haible
Subject: Re: Honoring TMP and TEMP environment variables in tmpdir.c
Date: Sun, 7 Feb 2010 13:47:48 +0100
User-agent: KMail/1.9.9

Juan Manuel Guerrero wrote:
> ... but the TMP and/or TEMP environment variables are almost certainly set.

On a Win32 system (Windows XP SP3, German), these two variables are set by
default to
  C:\DOKUME~1\username\LOKALE~1\Temp
which is not appropriate for Win32 programs: Everyone knows that this
concept of "short filenames" is a hack for the MSDOS subsystem.
  - It causes bugs.
  - It offers only limited memory (32 MB per process, IIRC).
  - The MSDOS subsystem is recommended to be disabled, due to security
    reasons. [1]

Therefore I'm against using getenv("TMP") or getenv("TEMP") on Win32.

Instead, since a directory c:\temp appears to exist by default on Windows
systems, how about trying "c:/temp" before trying P_tmpdir? (mingw defines
_P_tmpdir to "\\" but does not define P_tmpdir, whereas MSVC defines
_P_tmpdir and P_tmpdir to "\\".)

Regarding DJGPP, I believe there is no point in improving DJGPP support in GNU
packages at this point in time, IMO. EMX and DJGPP filled a hole, allowing to
build programs in 32-bit mode on a 16-bit OS, up until 1995. Since 1995, the
Win32 API exists and is widely deployed. I am grateful for your contributions
to DJGPP support in my packages in the past, and it was important at that time,
but now it's 10 years later.

Bruno

[1] 
http://www.heise.de/newsticker/meldung/Windows-Luecke-nach-17-Jahren-gefunden-Update-908743.html




reply via email to

[Prev in Thread] Current Thread [Next in Thread]